Thursday, 11 June 2015

How to set Org context in 11i and R12

In 11i:

Begin
dbms_application_info.set_client_info('&ORG_ID');
End;




In R12:

BEGIN
   MO_GLOBAL.SET_POLICY_CONTEXT('S', <orgid>);
END;


To set the mo security profile so that sqlplus will have same org context as given responsibility
DECLARE
   l_resp_id number; 
   l_user_id number;
   l_security_profile_id number;
   l_org_id number;

BEGIN

   SELECT user_id
     INTO l_user_id
     FROM fnd_user
    WHERE user_name LIKE '&USER_NAME';

   SELECT responsibility_id
     INTO l_resp_id
     FROM FND_RESPONSIBILITY_VL
    WHERE responsibility_name LIKE '&responsibility_name';

   FND_GLOBAL.APPS_INITIALIZE(l_user_id,
                              l_resp_id,
                              <Application ID>); -- APPLICATION_ID: Oracle Payables is 200
   MO_GLOBAL.INIT('SQLAP');
END;
/


In SQL*plus

SQL> exec mo_global.init('SQLAP');
exec mo_global.set_policy_context('S','&org_id');

2 comments:

  1. Iam so thrilled because of finding your alluring website here.Actually i was searching for Oracle Fusion HCM Techno Functional.Your blog is so astounding and informative too..Iam very happy to find such a creative blog. Iam also find another one by mistake while am searching the same topic Oracle PPM Cloud.Thank you soo much.

    ReplyDelete
  2. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here .Same as your blog i found another one Oracle Fusion HCM . Actually I was looking for the same information on internet for Oracle Fusion HCM and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.

    ReplyDelete

AP Invoice Notes related Table details in Oracle Fusion

 What is the table that stores the AP Invoice notes? AP notes are stored in ZMM_NOTES table with SOURCE_OBJECT_CODE = 'AP_STANDARD_INVOI...