Join the OracleApps88 Telegram group @OracleApps88to get more information on Oracle EBS R12/Oracle Fusion applications.

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.

Friday, October 18, 2013

Oracle Apps Initialization using API in 11i



Procedure apps_initialize can be used to apps initialize from backend.

It is tested in 11i.

CREATE OR REPLACE PROCEDURE apps_initialize
IS
v_responsibility_name VARCHAR2 (100) := 'Payables';
v_user_name            VARCHAR2 (100) := 'Oracle';
v_application_id         NUMBER := 0;
v_responsibility_id      NUMBER := 0;
v_user_id                 NUMBER := 0;
v_flag                      NUMBER := 0;
BEGIN
      --Getting Responsbility and Application Id
      BEGIN
           SELECT responsibility_id,
                      application_id
           INTO     v_responsibility_id,
                      v_application_id
           FROM   fnd_responsibility_tl
          WHERE  responsibility_name = v_responsibility_name
          AND LANGUAGE = USERENV ('LANG');
       EXCEPTION
          WHEN OTHERS
          THEN DBMS_OUTPUT.put_line( 'Error in getting Responsibility information and error is '|| SUBSTR (SQLERRM, 1, 200));
             v_flag := 1;
         END;
        ----Getting User Id
        BEGIN
             SELECT user_id
             INTO v_user_id
             FROM fnd_user
             WHERE user_name = v_user_name;
        EXCEPTION
            WHEN OTHERS
           THEN DBMS_OUTPUT.put_line( 'Error in getting User information and error is '|| SUBSTR (SQLERRM, 1, 200));
                   v_flag := 1;
         END;

        IF v_flag = 0
        THEN fnd_global.apps_initialize (v_user_id,v_responsibility_id,v_application_id);
        END IF;
EXCEPTION
    WHEN OTHERS
     THEN DBMS_OUTPUT.put_line( 'Error in procedure apps initialize and error is '|| SUBSTR (SQLERRM, 1, 200));
END;
/

No comments:

Post a Comment

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect