Tuesday, October 24, 2017

API to create Independent Value Set in Oracle Apps

DECLARE
   value_set_name            VARCHAR2 (200);
   description                    VARCHAR2 (200);
   security_available        VARCHAR2 (200);
   enable_longlist             VARCHAR2 (200);
   format_type                  VARCHAR2 (200);
   maximum_size             NUMBER;
   PRECISION                 NUMBER := NULL;
   numbers_only               VARCHAR2 (200);
   uppercase_only             VARCHAR2 (200);
   right_justify_zero_fill   VARCHAR2 (200);
   min_value                     VARCHAR2 (200);
   max_value                    VARCHAR2 (200);
   v_session_mode           VARCHAR2 (20) := 'customer_data';
   x_out                            VARCHAR2 (200);
   v_msg                          VARCHAR2 (2000);
BEGIN
   fnd_flex_val_api.set_session_mode (v_session_mode);
 
   value_set_name := 'XX_SOURCE';
   description := 'Valueset for Source';
   security_available := 'N';
   enable_longlist := 'N';
   format_type := 'C';
   maximum_size := 240;
   --PRECISION := ;
   numbers_only := 'N';
   uppercase_only := 'N';
   right_justify_zero_fill := 'N';
   min_value := NULL;
   max_value := NULL;

   IF (apps.fnd_flex_val_api.valueset_exists (value_set_name))
   THEN
      DBMS_OUTPUT.put_line ('Value set Already Exists..Deleting it....');
      apps.fnd_flex_val_api.delete_valueset (value_set_name);
   END IF;

   IF NOT (apps.fnd_flex_val_api.valueset_exists (value_set_name))
   THEN
      DBMS_OUTPUT.put_line ('Value set doesn''t exists.. Creating it...');
      apps.fnd_flex_val_api.create_valueset_independent (
         value_set_name,
         description,
         security_available,
         enable_longlist,
         format_type,
         maximum_size,
         PRECISION,
         numbers_only,
         uppercase_only,
         right_justify_zero_fill,
         min_value,
         max_value);
      COMMIT;

      IF (apps.fnd_flex_val_api.valueset_exists (value_set_name))
      THEN
         DBMS_OUTPUT.put_line (
            'Value set:' || value_set_name || ' got created');
      END IF;
   END IF;
EXCEPTION
   WHEN OTHERS
   THEN
      v_msg := fnd_flex_val_api.MESSAGE;
      DBMS_OUTPUT.put_line (v_msg);
      DBMS_OUTPUT.put_line (SQLERRM);
END;

No comments:

Post a Comment

SupplierAddressImportTemplate.xlsm South Africa Suburb Field mapping in POZ_SUPPLIER_ADDRESSES_INT

Suburb mpping in Supplier Address Import Template will be mapped to Address Element Attribute2 (HZ_LOCATIONS. ADDR_ELEMENT_ATTRIBUTE2)