API To Create Organizations In Oracle Apps


Following script can be used to create an Organization in Oracle Apps.

Using API: p_organization_rec hz_party_v2pub.organization_rec_type;

Create Organization:

DECLARE
   p_organization_rec   hz_party_v2pub.organization_rec_type;
   x_return_status      VARCHAR2 (2000);
   x_msg_count          NUMBER;
   x_msg_data           VARCHAR2 (2000);
   x_party_id           NUMBER;
   x_party_number       VARCHAR2 (2000);
   x_profile_id         NUMBER;
BEGIN
   p_organization_rec.organization_name := 'abc';
   p_organization_rec.created_by_module := 'abc_demo';
   hz_party_v2pub.create_organization ('T',
                                       p_organization_rec,
                                       x_return_status,
                                       x_msg_count,
                                       x_msg_data,
                                       x_party_id,
                                       x_party_number,
                                       x_profile_id
                                      );
   DBMS_OUTPUT.put_line ('party id ' || x_party_id);
   DBMS_OUTPUT.put_line (SUBSTR ('x_return_status = ' || x_return_status,
                                 1,
                                 255
                                )
                        );
   DBMS_OUTPUT.put_line ('x_msg_count = ' || TO_CHAR (x_msg_count));
   DBMS_OUTPUT.put_line (SUBSTR ('x_msg_data = ' || x_msg_data, 1, 255));

   IF x_msg_count > 1
   THEN
      FOR i IN 1 .. x_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;
END;
/

The above API will create records in hz_parties table in apps schema.


No comments:

Post a Comment

How to find all cancel Requisitions

SELECT prha . *   FROM po_Requisition_headers_all prha , po_action_history pah   WHERE      1 = 1        AND pah . object_id ...