Thursday, March 6, 2014

Get All Responsibilities of a FND User in Oracle Apps R12

SELECT fu.user_name, fr.responsibility_name, furg.start_date, furg.end_date
  FROM apps.fnd_user_resp_groups_direct furg,
       apps.fnd_user fu,
       apps.fnd_responsibility_tl fr
 WHERE furg.user_id = fu.user_id
   AND furg.responsibility_id = fr.responsibility_id
   AND fr.LANGUAGE = USERENV ('LANG')
   AND fu.user_name LIKE 'AYAAN'

------------------------------------------------------------------------------------------------------------

SELECT DISTINCT fu.user_name, papf.employee_number, papf.full_name,
                fres.responsibility_name responsibility,
                (SELECT NAME
                   FROM hr_operating_units
                  WHERE organization_id = paaf.organization_id) company
           FROM fnd_user_resp_groups_direct fur,
                fnd_user fu,
                fnd_responsibility_vl fres,
                per_all_people_f papf,
                per_all_assignments_f paaf
          WHERE fu.user_id = fur.user_id
            AND fres.responsibility_id = fur.responsibility_id
            AND papf.person_id = paaf.person_id
            AND papf.person_id = fu.employee_id
            AND papf.current_employee_flag = 'Y'
            AND papf.employee_number IS NOT NULL
            AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date
                                    AND papf.effective_end_date
            AND TRUNC (SYSDATE) BETWEEN paaf.effective_start_date
                                    AND paaf.effective_end_date
       ORDER BY fu.user_name;

No comments:

Post a Comment