Query to find all Responsibilities with excluded Functions and Menus


Script:

SELECT distinct frv.responsibility_name,
       DECODE (frf.rule_type,
               'F', 'Function',
               'M', 'Menu',
               rule_type
              ) exclusion_type,
       DECODE (frf.rule_type,
               'F', (SELECT function_name || ',' || description
                       FROM fnd_form_functions_vl fnc
                      WHERE fnc.function_id = frf.action_id),
               'M', (SELECT menu_name || ',' || description
                       FROM fnd_menus_vl imn
                      WHERE imn.menu_id = frf.action_id),
               TO_CHAR (frf.action_id)
              ) excluded_menu_or_func
  FROM apps.fnd_resp_functions frf,
       apps.fnd_responsibility_tl frv
WHERE frf.responsibility_id = frv.responsibility_id
and frv.responsibility_name like '%&responsibility_name%'