SELECT fu.user_name,
frtl.responsibility_name,
ffl.user_function_name,
fff.function_name
FROM fnd_user fu,
fnd_user_resp_groups furg,
fnd_responsibility fr,
fnd_compiled_menu_functions
fcmf,
fnd_form_functions fff,
fnd_responsibility_tl frtl,
fnd_form_functions_tl ffl
WHERE furg.responsibility_id = fr.responsibility_id
AND
furg.responsibility_application_id = fr.application_id
AND fr.menu_id = fcmf.menu_id
AND fcmf.grant_flag = 'Y'
AND fcmf.function_id = fff.function_id
AND furg.user_id = fu.user_id
AND SYSDATE BETWEEN fu.start_date AND NVL (fu.end_date, SYSDATE + 1)
AND SYSDATE BETWEEN fr.start_date AND NVL (fr.end_date, SYSDATE + 1)
AND furg.responsibility_id = frtl.responsibility_id
AND fr.responsibility_id = frtl.responsibility_id
AND frtl.language = 'US'
AND ffl.language = 'US'
AND fff.function_id = ffl.function_id
AND (furg.end_date > SYSDATE OR furg.end_date IS NULL)
AND fu.user_name = 'USERNAME_TO_BE_CHECKED'
AND frtl.responsibility_name = 'CURRENT_RESPONSIBILITY'
AND fff.function_name NOT IN
(SELECT
ff.function_name
FROM
fnd_responsibility r,
fnd_user_resp_groups
rg,
fnd_user u,
fnd_resp_functions rf,
fnd_form_functions ff,
fnd_responsibility_tl
frtl
WHERE rg.responsibility_id = r.responsibility_id
AND u.user_id = rg.user_id
AND rf.responsibility_id = r.responsibility_id
AND rf.rule_type = 'F'
AND ff.function_id = rf.action_id
AND frtl.responsibility_id = r.responsibility_id
AND frtl.responsibility_id = rg.responsibility_id
AND frtl.language = 'US'
AND u.user_name = UPPER ('USERNAME_TO_BE_CHECKED')
AND frtl.responsibility_name = 'CURRENT_RESPONSIBILITY'
)
AND fff.function_name NOT IN
(SELECT function_name
FROM (SELECT DISTINCT
(SELECT function_name
FROM fnd_form_functions f
WHERE f.function_id = me.function_id
) function_name
, menu_id
FROM fnd_menu_entries me
START WITH me.menu_id IN
(SELECT rf.action_id
FROM fnd_responsibility r,
fnd_user_resp_groups rg,
fnd_user u,
fnd_resp_functions rf,
fnd_responsibility_tl frtl
WHERE rg.responsibility_id = r.responsibility_id
AND u.user_id = rg.user_id
AND rf.responsibility_id = r.responsibility_id
AND rf.rule_type = 'M'
AND frtl.responsibility_id = r.responsibility_id
AND frtl.responsibility_id = rf.responsibility_id
AND u.user_name = UPPER ( 'USERNAME_TO_BE_CHECKED')
AND frtl.responsibility_name = 'CURRENT_RESPONSIBILITY')
CONNECT BY me.menu_id = PRIOR me.sub_menu_id)
WHERE function_name IS NOT NULL
)
ORDER BY 1, 2, 3
1 comment:
If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 (https://t.me/apps88) in telegram.
Post a Comment