FND_PROGRAM | Register, Attach, Submit, Delete Concurrent program using API
FND_PROGRAM : Concurrent Program Loader
The FND_PROGRAM package includes procedures for
- Register the Concurrent Program Executable, Concurrent Programs
- Attach Concurrent program to a Request Group
- Submit Concurrent program
The FND_PROGRAM package also contains functions you can use to check for the existence of concurrent programs, executables, parameters, and incompatibility rules.
1) Registering the Executable from back end
Use this procedure to define a Concurrent Program Executable. This procedure corresponds to the “Concurrent Program Executable” window accessible from the System Administrator and Application Developer responsibilities.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| BEGIN Fnd_Program.executable ( executable => 'TEST_SPO_REPORT' ,short_name => 'TEST_SPO_REPORT' ,application => 'PO' ,description => 'TEST_SPO_REPORT' ,execution_method => 'SQL*Loader' ,execution_file_name => 'TEST_SPO_REPORT' ,subroutine_name => NULL ,ICON_NAME => NULL ,LANGUAGE_CODE => 'US' ,EXECUTION_FILE_PATH => NULL ); commit ; END ; |
VARIABLE | DESCRIPTION |
---|---|
executable | Name of executable (for example, ‘FNDSCRMT’). |
application | The short name of the executable’s application, for example, ‘FND’. |
description | Optional description of the executable. |
execution_ method | The type of program this executable uses. Possible values are ‘Host’, ‘Immediate’, ‘Oracle Reports’, ‘PL/SQL Stored Procedure’, ‘Spawned’, ‘SQL*Loader’, ‘SQL*Plus’. |
execution_ file_name | The operating system name of the file. Required for all but Immediate programs. This file name should not include spaces or periods unless the file is a PL/SQL stored procedure. |
subroutine_name | Used only by Immediate programs. Cannot contain spaces or periods. |
icon_name | Reserved for future use by internal developers only. Specify NULL. |
language_code | Language code for the name and description, for example, ‘US’. |
2) Registering the Concurrent program from back end
Use this procedure to define a concurrent program.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| BEGIN Fnd_Program.register ( program => 'TEST_SPO_REPORT' ,application => 'PO' ,enabled => 'Y' ,short_name => 'TEST_SPO_REPORT' ,description => 'TEST_SPO_REPORT' ,executable_short_name => 'TEST_SPO_REPORT' ,executable_application => 'PO' ,priority => NULL ,save_output => 'Y' ,print => 'N' ,cols => 132 , ROWS => 45 ,style => NULL --'A4' --to be checked ,style_required => 'N' ,printer => NULL --to be checked ,use_in_SRS => 'Y' ,allow_disabled_values => 'N' ,run_alone => 'N' ,enable_trace => 'N' ,restart => 'Y' ,nls_compliant => 'Y' ,output_type => 'Text' ,execution_options => NULL ,request_type => NULL ,request_type_application => NULL ,icon_name => NULL ,language_code => 'US' ,mls_function_short_name => NULL ,mls_function_application => NULL ,incrementor => NULL ); COMMIT ; END ; |
VARIABLE | DESCRIPTION |
---|---|
program | The user-visible program name, for example ‘Menu Report’. |
application | The short name of the application that owns the program. The program application determines the Oracle user name used by the program. |
enabled | Specify either “Y” or “N”. |
short_name | The internal developer program name. |
description | An optional description of the program. |
executable_name | The short name of the registered concurrent program executable. |
executable_ application | The short name of the application under which the executable is registered. |
execution_ options | Any special option string, used by certain executables such as Oracle Reports. |
priority | An optional program level priority. |
save_output | Indicate with “Y” or “N” whether to save the output. |
Allow printing by specifying “Y”, otherwise “N”. | |
cols | The page width of report columns. |
rows | The page length of report rows. |
style | The default print style name. |
style_required | Specify whether to allow changing the default print style from the Submit Requests window. |
printer | Force output to the specified printer. |
request_type | A user-defined request type. |
request_type_ application | The short name of the application owning the request type. |
use_in_srs | Specify “Y” to allow users to submit the program from the Submit Requests window, otherwise “N”. |
allow_ disabled_values | Specify “Y” to allow parameters based on outdated value sets to validate anyway. Specify “N” to require current values. |
run_alone | Program must have the whole system to itself. (“Y” or “N”) |
output_type | The type of output generated by the concurrent program. Either “HTML”, “PS”, “TEXT” or “PDF”. |
enable_trace | Specify “Y” if you want to always enable SQL trace for this program, “N” if not. |
nls_compliant | Reserved for use by internal developers only. Use “N”. |
icon_name | Reserved for use by internal developers only. Use NULL. |
language_code | Language code for the name and description. |
mls_function_ short_name | The name of the registered MLS function. |
mls_function_ application | The short name of the application under which the MLS function is registered. |
incrementor | The incrementor PL/SQL function name. |
3) Attaching the concurrent program to the request group
Use this procedure to add a concurrent program to a request group
1
2
3
4
5
6
7
8
9
10
11
| BEGIN Fnd_Program.add_to_GROUP ( 'TEST_SPO_REPORT' , 'PO' , 'All Reports' , 'PO' ); commit ; end ; |
VARIABLE | DESCRIPTION |
---|---|
program_short_ name | The short name used as the developer name of the concurrent program. |
program_ application | The application that owns the concurrent program. |
request_group | The request group to which to add the concurrent program. |
group_ application | The application that owns the request group. |
4) Submitting Concurrent Program from Back-end
Submits a concurrent request for processing by a concurrent manager. If the request completes successfully, this function returns the concurrent request ID; otherwise, it returns 0.
The FND_REQUEST.SUBMIT_REQUEST function returns the concurrent request ID upon successful completion. It is then up to the caller to issue a commit to complete the request submission.
Your code should retrieve and handle the error message generated if there is a submission problem (the concurrent request ID returned is 0). Use FND_MESSAGE.RETRIEVE and FND_MESSAGE.ERROR to retrieve and display the error (if the request is submitted from the client side).
fnd_global.apps_initialize(user_id,responsibility_id,application_responsibility_id)
The FND_REQUEST.SUBMIT_REQUEST function returns the concurrent request ID upon successful completion. It is then up to the caller to issue a commit to complete the request submission.
Your code should retrieve and handle the error message generated if there is a submission problem (the concurrent request ID returned is 0). Use FND_MESSAGE.RETRIEVE and FND_MESSAGE.ERROR to retrieve and display the error (if the request is submitted from the client side).
fnd_global.apps_initialize(user_id,responsibility_id,application_responsibility_id)
1
2
3
4
5
6
7
8
9
10
11
| DECLARE v_request_id NUMBER(30); begin FND_GLOBAL.APPS_INITIALIZE (user_id => 1318, resp_id => 59966, resp_appl_id => 20064); v_request_id:= FND_REQUEST.SUBMIT_REQUEST ( 'PO' --Application Short name, 'TEST_SPO_REPORT' -- Concurrent Program Short Name ); DBMS_OUTPUT.PUT_LINE(l_request_id); commit ; END ; |
Once the concurrent program is submitted from back-end, status of the concurrent program can be checked using below query.
SELECT * FROM FND_CONCURRENT_REQUESTS WHERE REQUEST_ID= l_request_id;
5) Delete a concurrent program from back-end
1
2
3
4
| BEGIN Fnd_Program.delete_program ( 'TEST_SPO_REPORT' , 'PO' ) ; commit; END; |
1
2
3
4
| Begin Fnd_Program.delete_executable( 'TEST_SPO_REPORT' , 'INV' ); commit ; END ; |
0 comments