FND_PROGRAM | Concurrent Program Loader

By Jag - March 12, 2014
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;
VARIABLEDESCRIPTION
executableName of executable (for example, ‘FNDSCRMT’).
applicationThe short name of the executable’s application, for example, ‘FND’.
descriptionOptional description of the executable.
execution_ methodThe type of program this executable uses. Possible values are ‘Host’, ‘Immediate’, ‘Oracle Reports’, ‘PL/SQL Stored Procedure’, ‘Spawned’, ‘SQL*Loader’, ‘SQL*Plus’.
execution_ file_nameThe 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_nameUsed only by Immediate programs. Cannot contain spaces or periods.
icon_nameReserved for future use by internal developers only. Specify NULL.
language_codeLanguage 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;
VARIABLEDESCRIPTION
programThe user-visible program name, for example ‘Menu Report’.
applicationThe short name of the application that owns the program. The program application determines the Oracle user name used by the program.
enabledSpecify either “Y” or “N”.
short_nameThe internal developer program name.
descriptionAn optional description of the program.
executable_nameThe short name of the registered concurrent program executable.
executable_ applicationThe short name of the application under which the executable is registered.
execution_ optionsAny special option string, used by certain executables such as Oracle Reports.
priorityAn optional program level priority.
save_outputIndicate with “Y” or “N” whether to save the output.
printAllow printing by specifying “Y”, otherwise “N”.
colsThe page width of report columns.
rowsThe page length of report rows.
styleThe default print style name.
style_requiredSpecify whether to allow changing the default print style from the Submit Requests window.
printerForce output to the specified printer.
request_typeA user-defined request type.
request_type_ applicationThe short name of the application owning the request type.
use_in_srsSpecify “Y” to allow users to submit the program from the Submit Requests window, otherwise “N”.
allow_ disabled_valuesSpecify “Y” to allow parameters based on outdated value sets to validate anyway. Specify “N” to require current values.
run_aloneProgram must have the whole system to itself. (“Y” or “N”)
output_typeThe type of output generated by the concurrent program. Either “HTML”, “PS”, “TEXT” or “PDF”.
enable_traceSpecify “Y” if you want to always enable SQL trace for this program, “N” if not.
nls_compliantReserved for use by internal developers only. Use “N”.
icon_nameReserved for use by internal developers only. Use NULL.
language_codeLanguage code for the name and description.
mls_function_ short_nameThe name of the registered MLS function.
mls_function_ applicationThe short name of the application under which the MLS function is registered.
incrementorThe 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;
VARIABLEDESCRIPTION
program_short_ nameThe short name used as the developer name of the concurrent program.
program_ applicationThe application that owns the concurrent program.
request_groupThe request group to which to add the concurrent program.
group_ applicationThe 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)
?
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;
  • Share:

You Might Also Like

0 comments