Skip to main content

Function to inistalize apps

Function to inistalize apps


---------------------------------------------------------------------------------------------------
CREATE OR REPLACE PROCEDURE apps_initialize
IS
v_responsibility_name VARCHAR2 (100) := 'Payables';
v_user_name            VARCHAR2 (100) := 'XXXX';
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;



---------------------------------------------------------------------------------------------------

Comments

Popular posts from this blog

FND_PROFILE API In Oracle Apps

 FND_PROFILE API In Oracle Apps --------------------------------------------------------------------------------------------------- FND_PROFILE API is used very frequently in oracle apps development. The major purpose of this API is to: ·                      Retrieve user profile values for the current run-time environment ·                      Set user profile values for the current run-time environment FND_PROFILE API has different procedures and functions which are most frequently used. Following are the brief explanation of them: 1. FND_PROFILE.PUT:  This can be used to put a value to the specified user profile option. Example:  FND_Profile.Put(‘PROFILE_NAME’, ‘New_Value’) FND_Profile.Put(’USERNAME’, Usr_Name) FND_Profile.Pu...

PO Matching Setting in Purchase Order Shipment Line(2-way,3-way,4-way)

[PO] Matching Setting in Purchase Order Shipment Line Invoice matching can be set in five different areas of Oracle Purchasing: In the list below, a setting at any level will override the settings above it. 1. Oracle Purchasing Options a. Navigate to: Setup > Organizations > Purchasing Options b. Select Default Alternative Region 2. Supplier Information a. Navigate to: Supply Base > Suppliers b. Query on specific supplier c. Click on Open d. Select Receiving Alternative Region 3. Line Types a. Navigate to: Setup > Purchasing > Line Types b. In the Receipt Required field: Yes = 3-way, No = 2-way 4. Items a. Navigate to: Items > Master Items b. Query on specific item c. Select Purchasing Alternative Region d. In the Invoice Matching section: Yes = 3-way, No = 2-way 5. Purchase Order Shipments a. Navigate to: Purchase Orders > Purchase Orders b. Enter (header and) line information c. Click on Shipments button d. Select More Alternative Region Ramification of Invoice ...

Query To get the SMTP Server Details for a database server

Query To get the SMTP Server Details for a database server -------------------------------------------------------------------------------------------------------------------------------------- select fscpv.parameter_value "SMTP Host Name"       --SMTP protocol uses default port number 25 for outgoing emails       ,25                    "SMTP Port Number"       ,fscpt.description   from fnd_svc_comp_params_tl fscpt       ,fnd_svc_comp_param_vals fscpv  where fscpt.parameter_id = fscpv.parameter_id    and fscpt.display_name = 'Outbound Server Name' --'Inbound Server Name'    and fscpt.language = 'US'; --------------------------------------------------------------------------------------------------------------------------------------