Nonsense:
There has been no development for some time, do the project and rediscover the memory of the development of the point. Regain a little bit of fragmentation.
Run a lot of production line, configuration of some parameters also forget almost, long time did not move is easy to forget, find some information to make a note is the time bodyguard.
Business:
Fnd_request. The Submit_request function is used to submit a request, which returns a number value. The specific invocation is as follows
: Result: = Fnd_request.submit_request (Application CHAR,--die fast
Program CHAR,--Application
Description CHAR,--Request description (optional)
Start_time CHAR,--run time (optional)
Sub_request BOOLEAN,--Submit Request Now
Argument1 CHAR,--Parameter 1
Argument2 CHAR,--Parameter 2
Argument3 CHAR,--Parameter 3
Argument4 CHAR,--Parameter 4
ARGUMENT5 CHAR,--parameter 5 ....
Argument100 CHAR);
English Description:
Parameters is as follows:
> Application-short name of the application associated with the concurrent request to be submitted.
> program-short Name of the concurrent program (not the executable) for which the request should being submitted.
> Description-description of the request that's displayed in the Concurrent requests form. (Optional.)
> start_time-time at which the request should start running, formatted as HH24:MI or HH24:MI:SS (Optional.)
> Sub_request-set to TRUE If the request was submitted from another request and should be treated as a sub-request.
> Argument1 ... 100-arguments for the concurrent request; Up to arguments is permitted. If submitted from Oracle Forms, you must specify all arguments.
Additional notes:
When using Fnd_request.submit_request, the fifth parameter with false, do not be misled by the parameter name;
This function has 105 parameters, the first five define the request itself, and the next 100 are the specific parameters passed to the request, all of which are char types,
We need to convert, the default value is Chr (0), which means that this parameter is not passed to the calling request;
Attention:
1. In the package call only need to pass the required number of parameters, because it has a default value indicating the end;
2. In the form does not have to write 105, and we have to use a Chr (0) to indicate the end of the argument.
How to check Application (module), Program (Programs)
There are two ways: one is from the interface, the second through SQL to check.
Method One:
First you need to know which program (name) to execute. You can see the following: abbreviations, application products. The abbreviation is the value of the program item in request.
Then according to the corresponding "application product" name, to "registration" to find, will find a short name, and this "abbreviation" is the request corresponding to the value of the application.
Method Two:
SELECT DISTINCT
Fa. Application_short_name,
Fa. BasePath,
Fat. Application_name,
Fe. Executable_name,
Fe. Execution_file_name,
Fcp. Concurrent_program_name,
Fcp. Output_file_type,
Fcp. Output_print_style,
Fcpt.user_concurrent_program_name,
Fcpt. LANGUAGE,
Fcpt.description
from Fnd_application_tl fat,
Fnd_application FA,
Fnd_concurrent_programs_tl FCPT,
Fnd_concurrent_programs FCP,
Fnd_executables FE
WHERE 1 = 1
and Fat. application_id = fa. application_id
and Fat. LANGUAGE = fcpt. LANGUAGE
and FA. application_id = FCP. application_id
and FCPT. LANGUAGE = ' ZHS '
and FCPT. concurrent_program_id = FCP. concurrent_program_id
and fcp.executable_id = fe.executable_id
--and fcp.enabled_flag = ' Y '
and Fe. Executable_name = ' RVCTP '--the report name to be queried
Submit request (template) in form
In the form, you can use Apps.fnd_request. Submit_request
Submit a request to Oracle request Manager.
If the commit succeeds, the function returns the request ID, otherwise, 0 is returned.
Initialization
Before submitting a request, we call Oracle Standard's procedure to initialize some basic parameters for this request.
APPS. Fnd_global.apps_initialize
USER_ID =>apps. FND_GLOBAL.USER_ID,
resp_id =>apps. FND_GLOBAL.RESP_ID,
resp_appl_id =>apps. fnd_global.resp_appl_id
);
Fnd_request. Submit_request
function Apps.fnd_request. The Submit_request has 105 parameters:
APPS. Fnd_request. Submit_request
(
Application in VARCHAR2 DEFAULT NULL,
Program in VARCHAR2 DEFAULT NULL,
DESCRIPTION in VARCHAR2 DEFAULT NULL,
Start_time in VARCHAR2 DEFAULT NULL,
Sub_request in BOOLEAN DEFAULT FALSE,
Chr (0), ', ', ', ', ', ', ', ', ', ', ', ', ', ', ', ', ', ', ', ', ',
‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘, ‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,
‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘, ‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,
‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘, ‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,
‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘, ‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘,‘‘
)
RETURN number;
Example
PROCEDURE submit_request (p_group_id number) is
V_REQUEST_ID number;
V_ORG_ID number;
BEGIN
Fnd_global. Apps_initialize (Fnd_global. USER_ID,
Fnd_global. RESP_ID,
Fnd_global. RESP_APPL_ID);
Select Operating_unit
Into v_org_id
From Org_organization_definitions
where 1=1
and organization_id =:p arameter.org_id;
v_request_id: = Fnd_request. Submit_request (' PO ', ' rvctp ', ', ', ', false,
' BATCH ', p_group_id, v_org_id, CHR (0), ' ', ' ', ', ', ', ',
‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘,
‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘,
‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘,
‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘,
‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘,
‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘,
‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘,
‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘,
‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘‘ );
Commit;
Fnd_message. DEBUG (' submitted daemon ' | | ': ' | | ' Request_id= ' | | V_REQUEST_ID);
END;
Oracle ERP wait for report run mechanism
The main use of fnd_concurrent.wait_for_ruqest this function.
Fnd_concurrent.wait_for_request returns a Boolean value with the following key parameters:
function Fnd_concurrent. Wait_for_request
(request_id in number default NULL,--Request ID
Interval in number default 60,--Check time interval
Max_wait in number default 0,--Maximum wait time
Phase out VARCHAR2,
Status out Varchar2,
Dev_phase out VARCHAR2,--Request run phase
Dev_status out VARCHAR2,--each stage state
Message out VARCHAR2--output information after the run is complete)
return boolean;
Dev_phase There are several pending,running,complete,inactive, each corresponding to different dev-status, such as the complete stage after the normal,error,warning,cancelled , terminated and several other states.
For example:
BEGIN
L_request_status: = Fnd_concurrent.wait_for_request (l_request_id,
5,
0,
L_phase,
L_status,
L_dev_phase,
L_dev_status,
L_message);
IF L_request_status Then
IF l_dev_status = ' NORMAL ' Then
NULL;
ELSE
Fnd_message.debug (' request failed to run: ' | | l_dev_status);
RETURN;
END IF;
ELSE
Fnd_message.debug (' request not completed, unable to view report contents! ');
RETURN;
END IF;
Editor_pkg.report (l_request_id, ' Y ');
END;
Summary: Fnd_request. Submit_request is a way of submitting advice through the backend, can be used in the Pkg and form, in the form to use the parameters to write the whole. Fnd_concurrent. Wait_for_request is a program that waits for the current request to run, and can use this to wait for the current requestor to run and run the following program.
Sometimes submitting a request will always return a 0 situation:
Check if there is an initialization environment:
-- setting the initial method in the Plsql
SELECT user_id
Into l_num_user_id
From Applsys.fnd_user
WHERE user_name = ' user_name ';
SELECT responsibility_id
Into l_num_resp_id
From APPS.FND_RESPONSIBILITY_VL
WHERE responsibility_name = ' responsibility_name ';
SELECT application_id
Into l_num_resp_appl_id
From Applsys.fnd_application
WHERE application_short_name = ' app_short_name ';
Fnd_global.apps_initialize (user_id = l_num_user_id,
resp_id = l_num_resp_id,
resp_appl_id = l_num_resp_appl_id
);
-- set the initial method in the form
--direct reference to global variables
Fnd_global. Apps_initialize (Fnd_global. USER_ID,
Fnd_global. RESP_ID,
Fnd_global. RESP_APPL_ID);