Showing posts with label user responsibilities. Show all posts
Showing posts with label user responsibilities. Show all posts

Friday, March 11, 2011

To know the particular user responsibilities


To know the particular user responsibilities
Below query provides all responsibilities of all Users available in EBS, its same query as "Active Users" report.

select user_name, responsibility_name,application_name,
       greatest(u.start_date, ur.start_date, r.start_date) start_date,
        decode(
             least(nvl(u.end_date,to_date('01/01/4712','DD/MM/YYYY')),
                     nvl(ur.end_date,to_date('01/01/4712','DD/MM/YYYY')),
                      nvl(r.end_date,to_date('01/01/4712','DD/MM/YYYY'))),
             to_date('01/01/4712','DD/MM/YYYY'),'',
 least(nvl(u.end_date,  nvl(ur.end_date, r.end_date)),
             nvl(ur.end_date, nvl(u.end_date,  r.end_date)),
             nvl(r.end_date,  nvl(u.end_date,  ur.end_date)))) end_date,
             EMAIL_ADDRESS        
from fnd_user u,
     fnd_user_resp_groups_all ur,
     fnd_responsibility_vl r,
     fnd_application_vl a,
     fnd_security_groups_vl s
where a.application_id = r.application_id
and   u.user_id = ur.user_id
and   r.application_id = ur.responsibility_application_id
and   r.responsibility_id = ur.responsibility_id
and   ur.start_date <= sysdate
and   nvl(ur.end_date, sysdate + 1) > sysdate
and   u.start_date <= sysdate
and   nvl(u.end_date, sysdate + 1) > sysdate
and   r.start_date <= sysdate
and   nvl(r.end_date, sysdate + 1) > sysdate
order by user_name,application_name,responsibility_name