Thursday, 21 January 2016

Query to find responsibilities assigned to user in oracle apps

SELECT fu.user_name                "User Name",
       frt.responsibility_name     "Responsibility Name",
       furg.start_date             "Start Date",
       furg.end_date               "End Date",      
       fr.responsibility_key       "Responsibility Key",
       fa.application_short_name   "Application Short Name"
  FROM fnd_user_resp_groups_direct        furg,
       applsys.fnd_user                   fu,
       applsys.fnd_responsibility_tl      frt,
       applsys.fnd_responsibility         fr,
       applsys.fnd_application_tl         fat,
       applsys.fnd_application            fa
 WHERE furg.user_id             =  fu.user_id
   AND furg.responsibility_id   =  frt.responsibility_id
   AND fr.responsibility_id     =  frt.responsibility_id
   AND fa.application_id        =  fat.application_id
   AND fr.application_id        =  fat.application_id
   AND frt.language             =  USERENV('LANG')
   AND UPPER(fu.user_name)      =  UPPER('<USER_NAME>')  
   -- AND (furg.end_date IS NULL OR furg.end_date >= TRUNC(SYSDATE))  
   --if you want to see the current "Active" responsibilities of the user, remove the comment in above line.
 ORDER BY frt.responsibility_name;

(OR)


SELECT b.user_name, c.responsibility_name, a.start_date, a.end_date
  FROM fnd_user_resp_groups_direct a, fnd_user b, fnd_responsibility_tl c
 WHERE a.user_id = b.user_id
   AND a.responsibility_id = c.responsibility_id
   AND b.user_name = UPPER ('<USER_NAME>');

No comments:

Post a Comment