Sample Script to Schedule concurrent program from back end

Procedure xxTTK_schedule_prog
is

l_conc_id VARCHAR2(500);
l_responsibility_id NUMBER;
l_application_id NUMBER;
l_user_id NUMBER;
l_request_id NUMBER;
l_conc_id1 number;
l_language VARCHAR2(50);
l_territory VARCHAR2(50);
l_option_return BOOLEAN;
l_boolean boolean;
e_set_repeat exception;
L_conc_prg_name varchar2(1000);

BEGIN

SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = ‘APPUSER’;

SELECT responsibility_id, application_id
INTO l_responsibility_id, l_application_id
FROM fnd_responsibility_vl
WHERE responsibility_name = ‘India Local Receivables’
AND NVL (TRUNC (end_date), TRUNC (SYSDATE)) >= TRUNC (SYSDATE);

select iso_language,iso_territory into l_language, l_territory from fnd_languages where language_code = userenv(‘LANG’);

apps.fnd_global.apps_initialize
(l_user_id,l_responsibility_id,l_application_id);

select USER_CONCURRENT_PROGRAM_NAME INTO L_conc_prg_name from fnd_concurrent_programs_vl
WHERE CONCURRENT_PROGRAM_NAME =’MNFCNCP’;

l_option_return :=
FND_REQUEST.ADD_LAYOUT(‘XDO’,’MNFCNCP’,’en’,’US’,’PDF’);
l_boolean :=fnd_request.set_repeat_options
(repeat_time =>null
,repeat_interval => 1 –Applies only when repeat_time is null
,repeat_unit => ‘DAYS’–Applies only when repeat_time is null
,repeat_type => ‘START’ –Applies only when repeat_time is null
–,repeat_end_time =>
,increment_dates => ‘Y’– Increment the date parameters for next run
);

if l_boolean then
l_conc_id:=APPS.FND_REQUEST.SUBMIT_REQUEST
(application =>’XDO’,–l_app_shrt_name,
program => ‘MNFCNCP’,
description =>L_conc_prg_name,
start_time =>to_char(’26-AUG-2021 18::24:23′,’DD-MON-YYYY HH24:MI:SS’),
sub_request =>FALSE,
argument1 =>argument1,
argument2 =>argument2,
argument3 =>argument3,
argument4 =>argument4,
argument5 =>’Y’);

Commit;
dbms_output.put_line (‘Concurrent request failed to submit’);

End;

Recent Posts

Start typing and press Enter to search