Thursday, October 24, 2013

Initializing apps

DECLARE
   L_APPL_ID             number;
   l_appl_name           VARCHAR2 (100) := 'PER';
   L_USER_ID             number;
   l_user_name           VARCHAR2 (100) := 'XX_ADMIN';
   l_responsibility_id   NUMBER;
   l_resp_name           VARCHAR2 (200) := 'US Super HRMS Manager';
BEGIN

-- To get the Application ID of given Application.
   SELECT application_id
     INTO l_appl_id
     FROM fnd_application
    WHERE application_short_name = l_appl_name;

-- To get the User ID information of  given user
   SELECT user_id
     INTO l_user_id
     FROM fnd_user
    WHERE user_name = l_user_name;

-- To get the Resp ID information of the given responsibility.
   SELECT responsibility_id
     INTO l_responsibility_id
     FROM fnd_responsibility_tl
    WHERE responsibility_name = l_resp_name AND application_id = l_appl_id;

--Initialixze the Application to use the API.
   fnd_global.apps_initialize (l_user_id, l_responsibility_id, l_appl_id);
END;

No comments:

Post a Comment