, ,

Setting Org Context in Oracle Apps

Setting the Multi Org Context :


METHOD 1:

begin
    MO_GLOBAL.SET_POLICY_CONTEXT(ACCESS_MODE,ORG_ID);
end;

Example:

begin
    MO_GLOBAL.SET_POLICY_CONTEXT(‘S’,101);
end;

S – Denotes that the current session will work for Single Org_id (101)

M – Denotes that the current session will work for Multiple Org_id


 
METHOD 2:

begin
mo_global.init (<APPLICATION SHORT NAME>);
end;

Example :

begin
mo_global.init (‘AR’);
end;


Query :

select Application_short_name , application_name
from   fnd_application fapp,
       fnd_application_tl fappt
where  fapp.APPLICATION_ID = fappt.application_id
and    fappt.language = ‘US’
and    application_name = ‘General Ledger’

—————————————————————–

Setting the Application Context :

METHOD 1:

begin
fnd_global.apps_initialize(p_user_id, p_resp_id, p_resp_appl_id);
end;

Example :

begin
      fnd_global.APPS_INITIALIZE(200131258,20004,51710);
end;

begin
      fnd_global.APPS_INITIALIZE
      (user_id       => 200131258,
       resp_id       => 20004,
       resp_appl_id  => 51710
      );
end;

Query to find resp_is , resp_appl_id and user_id

select  responsibility_id
       ,application_id
       ,responsibility_name
from   fnd_responsibility_tl
where  upper(responsibility_name) IN ( upper(‘Receivables Manager’), upper(‘Application Developer’ ) )
and    language = ‘US’;


select  user_id
from    fnd_user
where  upper(user_name) = ‘SAIF’;

SELECT fnd_profile.value (‘RESP_ID’) FROM dual

SELECT fnd_profile.value (‘USER_ID’) FROM dual

SELECT fnd_profile.value (‘APPLICATION_ID’) FROM dual

SELECT TO_NUMBER (FND_PROFILE.VALUE( ‘LOGIN_ID ‘)) FROM dual

SELECT FND_PROFILE.VALUE(‘ORG_ID’) FROM dual

SELECT FND_PROFILE.VALUE(‘SO_ORGANIZATION_ID’) FROM dual

SELECT FND_PROFILE.VALUE(‘USERNAME’) FROM dual

SELECT FND_PROFILE.VALUE(‘GL_SET_OF_BKS_ID’) FROM dual

METHOD 2 :

begin
dbms_application_info.set_client_info(‘<org id>’);
end;

Example

begin
dbms_application_info.set_client_info(‘101’);
end;

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply