Thursday, January 14, 2016

Responsibility and Attached operating unit Query in oracle application - Profile Option: MO: Operating Unit

SELECT   SUBSTR (pro1.user_profile_option_name, 1, 35) PROFILE,
         DECODE (pov.level_id,
                 10001, 'Site',
                 10002, 'Application',
                 10003, 'Resp',
                 10004, 'User'
                ) option_level,
         DECODE (pov.level_id,
                 10001, 'Site',
                 10002, appl.application_short_name,
                 10003, resp.responsibility_name,
                 10004, u.user_name
                ) level_value,
                (select SECURITY_PROFILE_NAME from hr.per_security_profiles
where SECURITY_PROFILE_ID= pov.profile_option_value) profile_name,      
 --NVL (pov.profile_option_value, 'Is Null') profile_option_value,
         (SELECT NAME
            FROM apps.hr_operating_units
           WHERE organization_id = pov.profile_option_value) opertingunit
    FROM apps.fnd_profile_option_values pov,
         apps.fnd_responsibility_tl resp,
         apps.fnd_application appl,
         apps.fnd_user u,
         apps.fnd_profile_options pro,
         apps.fnd_profile_options_tl pro1
   WHERE pro1.user_profile_option_name = ('MO: Security Profile')
     AND pro.profile_option_name = pro1.profile_option_name
     AND pro.profile_option_id = pov.profile_option_id
     AND pov.level_value = resp.responsibility_id(+)
     AND pov.level_value = appl.application_id(+)
     AND pov.level_value = u.user_id(+)
     AND pov.level_id = 10003
ORDER BY 3;


No comments:

Post a Comment