Wednesday, May 30, 2012

Handling Date formats and passing date to concurrent program

Below note is only applicable if value set FND_STANDARD_DATE is used in oracle apps concurrent program.

Date parameters are passed from concurrent programs to subroutines in the format of  YYYY/MM/DD HH:MM:SS (eg: 2012/01/31 00:00:00). Date from concurrent program cannot be used directly in the programs. To handle date input from concurrent program, it has to be accepted in variable of VARCHAR2 and  convert to date format using the expression

           TO_DATE (SUBSTR (<date_variable>, 1, 10), 'yyyy/mm/dd')
                                                               OR
          select FND_DATE.CANONICAL_TO_DATE(<date_variable>) from dual;

Passing date to fnd_request.submit_request

Date can only be passed to fnd_request.submit_request in the format of  YYYY/MM/DD HH:MM:SS (eg: 2012/01/31 00:00:00). Any other format will lead to error or invalid date conversion. Once accepted from concurrent program date will be converted to the format of 'DD-MON-YY'. It should be converted before passing to submit_request using the expression

to_char(to_date(<date_variable>,'DD-MON-YY'),'yyyy/mm/dd')||' 00:00:00'

7 comments:

  1. Hi
    i am having issues when passing date parameters to fnd_request.submit_request.

    please can provide me working example of this.

    how to use date parameters in fnd_request.submit_request

    ReplyDelete
  2. Thank you it worked:

    Passing date to fnd_request.submit_request

    Date can only be passed to fnd_request.submit_request in the format of YYYY/MM/DD HH:MM:SS (eg: 2012/01/31 00:00:00). Any other format will lead to error or invalid date conversion. Once accepted from concurrent program date will be converted to the format of 'DD-MON-YY'. It should be converted before passing to submit_request using the expression

    to_char(to_date(,'DD-MON-YY'),'yyyy/mm/dd')||' 00:00:00'

    ReplyDelete
    Replies
    1. Excellent .... it helps me more.

      Delete
  3. This worked. Thanks for posting this very useful info

    ReplyDelete
  4. Hi,
    I have tried the above format to pass date value by using FND_REQUEST.SUBMIT_REQUEST from a concurrent program. But, the program is getting into an error status (ORA-01861: literal does not match format string). Main program parameter list is attached with FND_STANDARD_DATE VS and Child program parameter list is attached with the same VS.
    Please, help me to overcome this issue.

    Thanks in advance.

    ReplyDelete
  5. To me the below code work well:

    In the procedure used by the concurrent program I defined the dates parameters as varchar2

    procedure checa_retencao ( x_error_buf OUT NOCOPY VARCHAR2
    , x_ret_code OUT NOCOPY NUMBER
    , p_date_ini in varchar2
    , p_date_end in varchar2
    ***
    **
    w_date_ini date;
    w_date_end date;

    begin

    w_date_ini := to_date(p_date_ini,'rrrr/mm/dd hh24:mi:ss');
    w_date_end := to_date(p_date_fim,'rrrr/mm/dd hh24:mi:ss');

    for r1 in (select * from oe_order_headers_all ooh
    where ooh.request_date between w_date_ini and w_date_fim)
    loop
    *
    *
    I hope it can help somebody.

    ReplyDelete