Below Query will give you the output of Active FND Users and Responsibilities with their HR Department name and Location.
SELECT a.user_name, a.description, b.responsibility_name, fat.application_name, (SELECT NAME FROM hr_all_organization_units haou WHERE haou.organization_id = paaf.organization_id) "DEPARTMENT" , (SELECT town_or_city FROM hr_locations_all WHERE location_id = paaf.location_id) "LOCATION_OF_USER" FROM fnd_user a, fnd_responsibility_tl b, fnd_responsibility fr, fnd_user_resp_groups_direct c, fnd_application_tl fat, per_all_people_f papf, per_all_assignments_f paaf WHERE a.user_id = c.user_id AND a.employee_id = papf.person_id AND papf.person_id = paaf.person_id AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date AND fat.application_id = c.responsibility_application_id AND fr.responsibility_id = b.responsibility_id AND fr.end_date IS NULL AND (c.end_date IS NULL OR c.end_date > SYSDATE) -- Active User Responsibilities AND (a.end_date IS NULL OR a.end_date > SYSDATE) -- Active Users AND b.responsibility_id = c.responsibility_id --and a.USER_NAME in ('') -- Enter Username here
No comments:
Post a Comment