0% found this document useful (0 votes)
38 views

Sample Code For FND - Submit and FND - Request API

The document provides sample code for using the FND_SUBMIT and FND_REQUEST APIs in Oracle Applications to submit and monitor concurrent request sets. The sample code creates a stored procedure that uses the FND_SUBMIT API to submit a predefined request set, places the procedure in a paused status until completion, and outputs status messages.

Uploaded by

黃芥豪
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Sample Code For FND - Submit and FND - Request API

The document provides sample code for using the FND_SUBMIT and FND_REQUEST APIs in Oracle Applications to submit and monitor concurrent request sets. The sample code creates a stored procedure that uses the FND_SUBMIT API to submit a predefined request set, places the procedure in a paused status until completion, and outputs status messages.

Uploaded by

黃芥豪
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Document 221542.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-st...

Copyright (c) 2018, Oracle. All rights reserved.

E-Business Suite Concurrent Processing - Sample Code for FND_SUBMIT and FND_REQUEST API's (Doc
ID 221542.1)

In this Document

Purpose
Requirements
Configuring
Instructions
Script

APPLIES TO:

Oracle Concurrent Processing - Version 11.5.10.2 to 12.2 [Release 11.5 to 12.2]


Information in this document applies to any platform.

PURPOSE

This sample code provides an example of usage of FND_REQUEST and FND_SUBMIT API's.

The code provided here is given as a reference, although the API's are supported this example code is not supported.

REQUIREMENTS

Register the procedure as a concurrent program

CONFIGURING

FND_SUBMIT test procedure and sample code

Creates a procedure called fnd_submit_test that can be registered and run as a concurrent program.
This procedure will use the FND_SUBMIT API to submit a request set. (Function Security Reports - This request set should be seeded, if
it is not available the values in the script may need to be changed.) The procedure will then place itself in a Paused status until the
request set completes.

INSTRUCTIONS

1. Install this procedure in the APPS schema.


2. Register the procedure as a concurrent program

CAUTION

This sample code is provided for educational purposes only, and is not supported by Oracle Support. It has been tested internally,
however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

SCRIPT

REM +==========================================================================
REM | Concurrent Processing Sample Code
REM |
REM | FILE:
REM | fnd_submit_test.pls
REM |
REM | REVISION:
REM | $Id$
REM |
REM | DESCRIPTION:
REM | FND_SUBMIT test procedure and sample code
REM | Creates a procedure called fnd_submit_test that can be registered
REM | and run as a concurrent program.
REM | This procedure will use the FND_SUBMIT API to submit a request set.

第 1 頁,共 3 頁 2018/6/18 下午 06:17


Document 221542.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-st...

REM | (Function Security Reports - This request set should be seeded, if


REM | it is not available the values in the script may need to be changed.)
REM | The procedure will then place itself in a Paused status until the
REM | request set completes.
REM |
REM | INSTRUCTIONS:
REM |
REM | 1. Install this procedure in the APPS schema.
REM |
REM | 2. Register the procedure as a concurrent program
REM |
REM |
REM +==========================================================================

whenever sqlerror exit failure rollback;

create or replace procedure fnd_submit_test (errbuf out varchar2,


retcode out varchar2) as

success boolean;
req_id number;
req_data varchar2(10);
srs_failed exception;
submitprog_failed exception;
submitset_failed exception;

begin

-- Use FND_FILE to output messages at each stage


fnd_file.put_line(fnd_file.log, 'Starting test...');

-- Read fnd_conc_global.request_data, if available then we have been


-- reawakened after the request set has completed.
-- If so, exit.
req_data := fnd_conc_global.request_data;

if (req_data is not null) then

errbuf := 'Done!';
retcode := 0 ;
return;
end if;

-- Step 1 - call set_request_set


fnd_file.put_line(fnd_file.log, 'Calling set_request_set...');

success := fnd_submit.set_request_set('FND', 'FNDRSSUB43');


if ( not success ) then
raise srs_failed;
end if;

fnd_file.put_line(fnd_file.log, 'Calling submit program first time...');

-- Step 2 - call submit program for each program in the set


success := fnd_submit.submit_program('FND','FNDMNFUN', 'STAGE10', 'System Administrator',
chr(0));
if ( not success ) then
raise submitprog_failed;
end if;

fnd_file.put_line(fnd_file.log, 'Calling submit program second time...');

success := fnd_submit.submit_program('FND','FNDMNMNU', 'STAGE10', 'System Administrator',


chr(0));
if ( not success ) then
raise submitprog_failed;
end if;

fnd_file.put_line(fnd_file.log, 'Calling submit program third time...');

success := fnd_submit.submit_program('FND','FNDMNNAV', 'STAGE10', 'System Administrator',


chr(0));
if ( not success ) then

第 2 頁,共 3 頁 2018/6/18 下午 06:17


Document 221542.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-st...

raise submitprog_failed;
end if;

-- Step 3 - call submit_set


fnd_file.put_line(fnd_file.log, 'Calling submit_set...');

req_id := fnd_submit.submit_set(null,true);

if (req_id = 0 ) then
raise submitset_failed;
end if;

fnd_file.put_line(fnd_file.log, 'Finished.');

-- Set conc_status to PAUSED, set request_data to 1 and exit


fnd_conc_global.set_req_globals(conc_status => 'PAUSED', request_data => '1') ;

errbuf := 'Request set submitted. id = ' || req_id;


retcode := 0;

exception
when srs_failed then
errbuf := 'Call to set_request_set failed: ' || fnd_message.get;
retcode := 2;
fnd_file.put_line(fnd_file.log, errbuf);
when submitprog_failed then
errbuf := 'Call to submit_program failed: ' || fnd_message.get;
retcode := 2;
fnd_file.put_line(fnd_file.log, errbuf);
when submitset_failed then
errbuf := 'Call to submit_set failed: ' || fnd_message.get;
retcode := 2;
fnd_file.put_line(fnd_file.log, errbuf);
when others then
errbuf := 'Request set submission failed - unknown error: ' || sqlerrm;
retcode := 2;
fnd_file.put_line(fnd_file.log, errbuf);
end;
/
rem ===================================================================
commit;
exit;

Didn't find what you are looking for?

第 3 頁,共 3 頁 2018/6/18 下午 06:17

You might also like