Showing posts with label ORG_ID. Show all posts
Showing posts with label ORG_ID. Show all posts

Friday, June 14, 2013

INVALID ORG ID error in Oracle Apps R12 API ( while calling ASO_QUOTE_PUB.COPY_QUOTE() API)

Hi,

If you are getting error as Invalid ORG Id error in Oracle Apps R12 while calling the seeded API means you need to follow the below steps.

Do the following before calling the API in R12

begin
mo_global.init('<Module>');
mo_global.set_policy_context('<S/M>',<org_id>); -- S for single Operating Unit and M for multiple Operating Unit
-- Call the Ar_receipt_api_pub.Create_cash API
END;


Also some of the public or Private API requires the Apps Initilization.

fnd_global.APPS_INITIALIZE (l_user_id, l_responsibility_id, l_appllication_id);


Example: mo_global.set_policy_context('S',FND_GLOBAL.ORG_ID);

Tuesday, June 11, 2013

FND_GLOBAL.APPS_INITIALIZE() process in R12

FND_GLOBAL.APPS_INITIALIZE

begin
     fnd_client_info.set_org_context(l_org_id);
end;

---------------------

l_org_id := fnd_profile.VALUE('ORG_ID');

mo_global.init ('ONT');
mo_global.set_policy_context('S',l_org_id);



FND_GLOBAL.APPS_INITIALIZE is used for initializing the session before calling any public or private API's in Oracle Ebusiness suite. Its not required for all the API's but its 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);
  1. l_user_id is the fnd user ID which will be utilized during the call.
  2. l_resp_id is the responsibility ID
  3. l_resp_appl_id is the responsibility application ID.
You can use either sysadmin or use some user who has 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 f
,      fnd_responsibility_tl res
where  f.user_name = 'SYSADMIN'
and    res.responsibility_name = 'Oracle Inventory';