Thursday, March 15, 2012

Initialize Apps in Oracle Applications

Apps initialize is used to set applications context in standalone sessions that were not initialized.This procedure sets up global variables and profile values in a database session. You can use this routine in independent programs like pl-sql, java in order to adopt apps related properties.


begin
 fnd_global.apps_initialize(&user_id,&resp_id,&resp_appl_id);
end;

Use below sql's to derive values used in apps_initialize.

SELECT fnd_profile.value (‘USER_ID’) FROM dual;
SELECT fnd_profile.value (‘RESP_ID’) FROM dual;
SELECT fnd_profile.value (‘RESP_APPL_ID’) FROM dual;
 or use below statement in your apps routine.
 
 fnd_global.apps_initialize(fnd_profile.value (‘USER_ID’) ,fnd_profile.value (‘RESP_ID’),fnd_profile.value (‘RESP_APPL_ID’) );
 
fnd_profile.value  cannot be accessed from SQL. These values will get initialize / passed to a routine only from Oracle Apps.

If a stand alone program needed to be initialized, hard code values in apps_initialize.

Corresponding values can be found using below SQL

user_id 
select user_id from fnd_user where user_name = <'user_name'>;

resp_id, resp_appl_id
 

select responsibility_id,application_id from fnd_responsibility_tl where responsibility_name = <'Your Resp Name'>

No comments:

Post a Comment