Friday, April 27, 2012

How to select profile option values for a profile option name with setup level details

Following query provides details of each profile option value at Site, Application, Responsibility, User, Organization, Server levels. The output gives the profile option name, profile option value,level at which each profile value is set(site, application, responsibility, user etc.).

Note:- Standard Package "FND_PROFILE_OPTION_VALUES_PKG" can be used to
            insert/update/delete profile option values at various levels.

Application Name,Responsibility Name, User Name if a profile is setup at each of the respective level:

Parameters:
  • User_Profile_Option_Name(can give partial value)
  • P_level_id(Values should be as mentioned from the below level_ids)
    •     10001  -  Site           
    •     10002  -  Application
    •     10003  -  Responsibility
    •     10004  -  User
    •     10005  -  Server
    •     10007  -  Organization
SELECT fpot.user_profile_option_name AS "USER_PROFILE_OPTION_NAME",
       DECODE (level_id,
               '10001', 'Site',
               '10002', 'Application',
               '10003', 'Responsibility',
               '10004', 'User',
               '10005', 'Server',
               '10007', 'Organization'
              ) AS "LEVEL",
       fpov.profile_option_value AS "Value", fpo.profile_option_name,
       SUBSTR (fat.application_name, 1, 20) AS "Application",
       (SELECT responsibility_name
          FROM fnd_responsibility_tl frt
         WHERE frt.responsibility_id = fpov.level_value
           AND fpov.level_id = 10003) "Responsibility",
       (SELECT user_name
          FROM fnd_user fu
         WHERE user_id = fpov.level_value
           AND fpov.level_id = 10004) "User"
  FROM fnd_profile_options fpo,
       fnd_profile_options_tl fpot,
       fnd_application_tl fat,
       fnd_profile_option_values fpov
 WHERE fpo.application_id = fat.application_id
   AND fpov.application_id = fat.application_id
   AND fpov.profile_option_id = fpo.profile_option_id
   AND fpo.profile_option_name = fpot.profile_option_name
   AND fpov.level_id = NVL (&p_level_id, fpov.level_id)
   AND UPPER (fpot.user_profile_option_name) LIKE
          NVL (UPPER ('%&User_Profile_Option_Name%'),
               UPPER (fpot.user_profile_option_name)
              );

Wednesday, April 18, 2012

How to Create/Update Party,Customer,Site using Business Object as parameter

--BPEL process calls EBS TCA (Trading Community Architecture) APIs via Apps Adapter to create and update
--Organizations (Parties) and Customers (Accounts) accordingly. TCA provides hz_org_cust_bo_pub API uses
--object types as parameters and is called Business Object(BO) API.

--Following is an example of how to create and update TCA party, customer, customer site etc
--Declare HZ_ORG_CUST_BO business object type variable to pass the customer payload:-

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

DECLARE
  
   l_hz_org_cust_bo   hz_org_cust_bo;
   x_xml              XMLTYPE;
   l_return_status    VARCHAR2 (4000);
   l_msg_count        NUMBER;
   l_org_id           NUMBER;
   l_msg_data         VARCHAR2 (4000);

BEGIN
-- Initialize to set the context
fnd_global.apps_initialize(<user_id>, <resp_id>, <resp_appl_id>);

-- This select statement should be of XMLTYPE datatype and should hold the HZ_ORG_CUST_BO type payload
-- starting and ending with HZ_ORG_CUST_BO_OBJ tag

   SELECT xml_data
     INTO x_xml
     FROM ar_custxml;

   x_xml.toobject (l_hz_org_cust_bo);

-- Call API to Create/Update Party/Customer details using Business Object as parameter
   hz_org_cust_bo_pub.save_org_cust_bo 
      (p_init_msg_list          => fnd_api.g_true,
       p_validate_bo_flag       => fnd_api.g_false,
       p_org_cust_obj           => l_hz_org_cust_bo,
       p_created_by_module      => 'BO_API',
       x_return_status          => l_return_status,
       x_msg_count              => l_msg_count,
       x_msg_data               => l_msg_data,
       x_organization_id        => l_org_id
              );
   COMMIT;
   DBMS_OUTPUT.put_line ('x' || l_return_status);
   DBMS_OUTPUT.put_line ('x' || l_msg_data || l_msg_count);
   DBMS_OUTPUT.put_line ('l_org_id: ' || l_org_id);

   IF l_msg_count > 1
   THEN
      FOR i IN 1 .. l_msg_count
      LOOP
         DBMS_OUTPUT.put_line
                      (   i
                       || '. '
                       || SUBSTR
                      fnd_msg_pub.get (p_encoded =>  
                                fnd_api.g_false),
                                1,
                                255
                               )
                      );
      END LOOP;
   END IF;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (SQLERRM);
END;
/

Wednesday, April 4, 2012

How to migrate Oracle B2B Setups across instances

Oracle B2B Setup Migration Steps

Following are the steps to migrate B2B Setups from one instance to
          another:-

Note: Before starting the migration in the target instance, we need to export all the
          b2b setups in the source instance by clicking on the "Export" button:- 

1.      Login to the B2B instance using the web browser:-

2.   Click on Administration/ “Import/Export” Tab:-


3.     After import, configure the keystore setup for the “XYZ” Partner as follows:-

4.     Click on “Browse” and select the file “MDS_EXPORT_DD_MON_RRRR.zip” from the local folder and check “Replace Existing MetaData” checkbox:-
5.     Click on “Import” button after selecting the file “MDS_EXPORT_DD_MON_RRRR.zip”:-

6.     Click on each Partner/Agreement item and click  on “Deploy”:-