Search This Blog

Wednesday, September 9, 2020

Add New Responsibility , Menu Exclusions from others responsibility in Oracle Apps R12

1. Creating New Responsibility

2. Menu Exclusions to copy into new Responsibility from existing. 

 


1.

 

DECLARE

v_rowid varchar2(500);

BEGIN

fnd_responsibility_pkg.insert_row

( x_rowid => v_rowid,

x_responsibility_id => fnd_responsibility_s.NEXTVAL,

x_application_id => 201, -- Cash Management

x_web_host_name => NULL,

x_web_agent_name => NULL,

x_data_group_application_id => 201, -- Cash Management

x_data_group_id => 0, -- Standard

x_menu_id => 68071, -- CE_CASH_MANAGER

x_start_date => SYSDATE,

x_end_date => NULL,

x_group_application_id => 201,

x_request_group_id => 129,

x_version => 4,

x_responsibility_key => 'TEST_RESPONSIBILITY2',

x_responsibility_name => 'Test Responsibility2',

x_description => 'Responsibility for testing',

x_creation_date => SYSDATE,

x_created_by => -1,

x_last_update_date => SYSDATE,

x_last_updated_by => -1,

x_last_update_login => -1

);

EXCEPTION WHEN OTHERS THEN

DBMS_OUTPUT.PUT_LINE(SQLERRM);

END;

commit;


2. Adding menu exclusions..


DECLARE

v_resp_id number := 52634; --pass here the new responsibility_id

   CURSOR c1

   IS

   

     SELECT

application_id, responsibility_id, action_id,

                      rule_type,

                      last_updated_by, last_update_date, creation_date,

                      created_by, last_update_login

                      FROM fnd_resp_functions

                      WHERE RESPONSIBILITY_ID = 50626; --getting all the menu exlusions from existing

                      

BEGIN

   FOR i IN c1

   LOOP

      BEGIN

         DBMS_OUTPUT.put_line ('Processing');

         INSERT INTO fnd_resp_functions

                     (application_id, responsibility_id, action_id,

                      rule_type,

                      last_updated_by, last_update_date, creation_date,

                      created_by, last_update_login

                     )

              VALUES (i.application_id, v_resp_id, i.action_id,

                      i.rule_type,

                      2605, SYSDATE, SYSDATE,

                      2605, -1

                     );

      EXCEPTION

         WHEN OTHERS

         THEN

            DBMS_OUTPUT.put_line (SQLERRM);

      END;

   END LOOP;

EXCEPTION

   WHEN OTHERS

   THEN

      DBMS_OUTPUT.put_line ('Completed');

END; 

No comments:

Post a Comment