Oracle Apps API to Run and Email Output concurrent program.

Posted by & filed under .

Oracle Apps API to Run and Email Output concurrent program.

Oracle Apps API to Schedule Concurrent Program.

Oracle Apps API to select Template and execute.

declare
l_conc_id     number;
l_boolean     boolean;
e_add_del     exception;
e_add_layout  exception;
e_set_option  exception;
e_set_repeat  exception;
begin
— intialize the apps.
fnd_global.apps_initialize (<user_id>,<resp_id>,<resp_app_id>);

— Adding delivery option to send the request output as email
l_boolean := fnd_request.add_delivery_option
(type => ‘E’ — this one to speciy the delivery option as email
,p_argument1 => ‘Delivery Option Test’ — subject for the mail
,p_argument2 => ‘xyz@ab.bc.uk’ — from address
,p_argument3 => ‘rty@ab.bc.uk’ — to address
,p_argument4 => ‘klm@ab.ac.uk’ — cc address to be specified here.
,nls_language => ”); — Optional

   /* — Adding delivery option to FTP the request output
l_boolean := fnd_request.add_delivery_option
(type => ‘T’ — this one to specify the delivery option as FTP
,p_argument1 => ‘uatdev.6auconsulting.com’ – Server Name/IP address
,p_argument2 => ‘oradev’ – Unix Box User
,p_argument3 => ‘oradevpass’ — Password
,p_argument4 => ‘/appl/UAT/apps/apps_st/comn/admin/XXAK/data/Test/’ – Directory Path
,nls_language => ”); — Optional  */

— Adding Template to the request
if l_boolean then
l_boolean := fnd_request.add_layout
(template_appl_name => ‘XXAK’
,template_code      => ‘XX_TEST_FND_REQUEST’
,template_language  => ‘en’ — English
,template_territory => null
,output_format      => ‘PDF’
);
else
raise e_add_del;
end if;

if l_boolean then
l_boolean := fnd_request.set_options (‘YES’);
else
raise e_add_layout;
end if;

– Scheduling the request
if l_boolean then
l_boolean :=fnd_request.set_repeat_options
(repeat_time     => null–to_char(sysdate,’hh24:mi:ss’),
,repeat_interval => 2   –Applies only when releat_time is null
,repeat_unit     => ‘MINUTES’–Applies only when releat_time is null
,repeat_type     => ‘START’ –Applies only when releat_time is null
–,repeat_end_time  =>
–,increment_dates  => ‘Y’– Increment the date parameters for next run
);
else
raise e_set_option;
end if;

if l_boolean then

l_conc_id := fnd_request.submit_request
(application => ‘XXAK’
,program     => ‘XX_TEST_FND_REQUEST’
,start_time  => null
,sub_request => null
,argument1   => <argument1>
,argument2   => <argument2>
);
else
raise e_set_repeat;
end if;

if l_conc_id > 0 then
dbms_output.put_line(‘Concurrent Program Id: ‘||l_conc_id);
else
dbms_output.put_line(‘Error: submit_request’);
end if;
commit;
exception
when e_add_del then
dbms_output.put_line(‘Error: add_delivery_option’);
when e_add_layout then
dbms_output.put_line(‘Error: add_layout’);
when e_set_option then
dbms_output.put_line(‘Error: set_options’);
when e_set_repeat then
dbms_output.put_line(‘Error: set_repeat_options’);
when others then
dbms_output.put_line(‘Error: ‘||sqlerrm);
end;

Leave a Reply

Your email address will not be published. Required fields are marked *