Wednesday, September 17, 2014

FND API to Delete, Add and Update value set values in Oracle Applications



ALTER SESSION SET CURRENT_SCHEMA = APPS;

DECLARE
   l_err_msg   VARCHAR2 (500) := NULL;

   CURSOR c1
   IS
      SELECT ffv.flex_value_id, ffv.flex_value
        FROM apps.fnd_flex_value_sets ffvs
            ,apps.fnd_flex_values ffv
            ,apps.fnd_flex_values_tl ffvt
       WHERE flex_value_set_name = 'XXXXXXXX'  -- Value Set Name
         AND ffv.flex_value_set_id = ffvs.flex_value_set_id
         AND ffvt.flex_value_id = ffv.flex_value_id
         AND ffvs.flex_value_set_id = ffv.flex_value_set_id
         AND ffvt.LANGUAGE = 'US'
         AND ffv.enabled_flag = 'Y'
         AND ffv.summary_flag = 'N'
         AND ffv.flex_value IN
                ('XXXXX'
                ,'XXXXXXXXXXX'
                ,'XXXXXXXL');
BEGIN
   FOR i IN c1
   LOOP
      apps.fnd_flex_values_pkg.delete_row (i.flex_value_id);
      COMMIT;
      DBMS_OUTPUT.put_line (i.flex_value_id || ' Deleted  Successfully !!!!');
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      l_err_msg := SQLERRM;
      DBMS_OUTPUT.put_line ('Exception: ' || l_err_msg);
END;

No comments:

Post a Comment