FND_GLOBAL.APPS_INITIALIZE
is used for initializing the session before calling any public or private API’s in Oracle E-business Suite. and also may be required when you want to execute the query in third-party tools like (TOAD) specifically when you want to get data from (VIEWS) objects in EBS. It’s not required for all the API’s but it’s recommended that you set this profile before making any calls to either private or public API.
Listed below is a sample call to FND_GLOBAL.APPS_INITIALIZE function
FND_GLOBAL.APPS_INITIALIZE( USER_ID=>L_USER_ID, RESP_ID=>L_RESP_ID, RESP_APPL_ID=>L_RESP_APPL_ID);
l_user_id: is the fnd user ID that will be utilized during the call.
l_resp_id : is the responsibility ID
l_resp_appl_id : is the responsibility application ID.
You can use sysadmin or some user with all the above-listed responsibilities.
For SYSADMIN, utilize the following query to get the respective values
SELECT FND.USER_ID, FRESP.RESPONSIBILITY_ID, FRESP.APPLICATION_ID
FROM FND_USER FND, FND_RESPONSIBILITY_TL FRESP
WHERE FND.USER_NAME = 'SYSADMIN'
AND FRESP.RESPONSIBILITY_NAME = 'Order Management Super User';
, or you can use this solution to get the values dynamically from the application when you extend a Custom Form as the following :
DECLARE
L_USER_ID NUMBER;
L_RESP_ID NUMBER;
L_RESP_APPL_ID NUMBER;
BEGIN
L_USER_ID := FND_GLOBAL.USER_ID;
L_RESP_ID := FND_GLOBAL.RESP_ID;
L_RESP_APPL_ID := FND_GLOBAL.RESP_APPL_ID;
FND_GLOBAL.APPS_INITIALIZE (USER_ID => L_USER_ID, RESP_ID => L_RESP_ID, RESP_APPL_ID => L_RESP_APPL_ID);
END;
Check Tutorial: Oracle Case Statement
Another option is Help > Diagnostics > Examine and get the values from $profile session values.
Hi Hassan, good afternoon
I liked your post and I have a doubt about that. I have an API ( using Process_Order OE_ORDER_PUB API to Record Customer Acceptance for Sales Orders)
I have to call for when a I have an event. When call I have to pass org_id and a line_id for table oe_orders_line_all. I have a some line_id for a header id, so I have to passa the parameter line_id in a loop. When I do a loop, do I need to execute fnd_global.apps_initialize inside a loop or once, outside the loop ?
Thank’s
Hi Denis,
thanks for your interesting about my article, regarding your question actually you need to initialise session only ones before API call.
hope this help