Submitting Future Requests Via Package fnd_request.submit_request

download Submitting Future Requests Via Package fnd_request.submit_request

of 2

Transcript of Submitting Future Requests Via Package fnd_request.submit_request

  • 8/12/2019 Submitting Future Requests Via Package fnd_request.submit_request

    1/2

    ome> Blog>

    ubmitting Future Requests Via Package

    nd_request.submit_requeststed Feb 26, 2014, 4:00 PM by Jay Tracewell [ updated Feb 26, 2014, 4:05 PM ]

    ere are many blogs on using fnd_request.submit_request to create a concurrent job, but there aren't very many

    w the package handles or expects the "start_date" parameter to be handled and Oracle's documentation is unc

    ou create a procedure where you declare a date variable, populate it and call the package like is shown below:

    declared_request_start_date DATE;

    ...

    d_request_start_date := to_date ('02272014 2055', 'MMDDYYYY HH24MI') ;

    ...

    n_request_id := fnd_request.submit_request(

    pplication => 'WSH'

    program => 'WSHPSRS'

    ,start_time => d_request_start_date

    ...

    u will successfully create a concurrent request in your system, but the start of that concurrent request will be 2

    -2014 at 00:00:00 - the d_request_start_date has failed to properly capture the time you assigned to this (20

    e DATE variable only captures the date (no timestamp); timestamp is only captured for DATE datatypes when s

    a table column.

    _request.submit_request will, however, accept varchar text as input for start_date (the input parameter is dec

    varchar) and will cast this as a date and time. Thus, if you send properly formatted text in this field, you'll rec

    uest with both the date and time that you require. A full example of a working procedure is below that starts

    uest on a specific day and time and repeats it every week at that time:

    et serveroutput oneclaren_request_id number := 0 ;v_request_start_date varchar(30);v_release_rule_name varchar(300);v_batch_prefix varchar(30) := NULL ;n_debug_level number := 0 ;n_ship_confirm_rule_id number := NULL ;d_actual_departure_date date := NULL ;n_child_requests number := NULL ;b_set_interval boolean := false ;b_set_nls boolean := false ;

    b_set_mode boolean := false ;

    egin/* Set global options */apps.fnd_global.apps_initialize(2315, 21623, 660); -- CM user, OM SuperUser resp, ONTpplicationb_Set_NLS := apps.fnd_submit.set_nls_options('AMERICAN');b_Set_Mode := apps.fnd_submit.set_mode (false); -- Only set to true if called fromatabase trigger

    /* AMW Std Sch Int Mon | WEEKLY THURSDAY 855 PM */dbms_output.put_line('Start Std Sch Int | WEEKLY THURSDAY 855 PM');select picking_rule_id into v_release_rule_name from WSH.WSH_PICKING_RULES where name =Std Sch Intl' ;

    v_request_start_date := to_char(to_date('02272014', 'MMDDYYYY')) || ' ' || '20:55:00' ;

    b_set_interval := fnd_request.set_repeat_options(

    https://sites.google.com/site/tracejmpro/home/bloghttps://sites.google.com/site/tracejmpro/home
  • 8/12/2019 Submitting Future Requests Via Package fnd_request.submit_request

    2/2

    repeat_time => NULL,repeat_interval => 7,repeat_unit => 'DAYS',repeat_type => 'START',repeat_end_time => NULL ;

    n_request_id := fnd_request.submit_request(application => 'WSH',program => 'WSHPSRS',start_time => v_request_start_date,sub_request => false,argument1 => v_release_rule_name

    ,argument2 => v_batch_prefix ,argument3 => n_debug_level ,argument4 => n_ship_confirm_rule_id

    ,argument5 => d_actual_departure_date ,argument6 => n_child_requests ;

    if n_request_id 0 thendbms_output.put_line('SUCCESS MW Std Sch Int Mon | WEEKLY THURSDAY 855 PM');elsedbms_output.put_line('FAIL MW Std Sch Int Mon | WEEKLY THURSDAY 855 PM');end if;

    nd;