Search This Blog

Wednesday, May 24, 2017

Fusion Payroll Query to get Payroll Relationship and BU Name

select p.person_number,
py.payroll_name,haou.name BUName
from PAY_ASSIGNED_PAYROLLS_DN ap
,    pay_PAYROLL_TERMS pt
,    PAY_PAY_RELATIONSHIPS_DN pr
,    PAY_ALL_PAYROLLS_F py
,    PER_ALL_PEOPLE_F p
,    per_all_assignments_m paam
,    hr_all_organization_units haou
,    (select distinct person_id from per_person_secured_list_v) ppsl
where ap.payroll_term_id = pt.payroll_term_id
and   pt.payroll_relationship_id = pr.payroll_relationship_id
and   ap.payroll_id = py.payroll_id
and   pr.person_id = p.person_id
--and p.person_number = '2824'
and ap.lsed is null
and paam.person_id=p.person_id
and trunc(sysdate) between paam.effective_start_date and paam.effective_end_date
and trunc(sysdate) between p.effective_start_date and p.effective_end_date
and paam.assignment_type = 'E'
and paam.primary_flag = 'Y'
and haou.organization_id = paam.business_unit_id
and ppsl.person_id = p.person_id

4 comments:

  1. What deos Ap.lsed is null denotes. i don't find the field in the concerned table.

    ReplyDelete
  2. Can we compare period name
    e.g- period_from & period_to in HCM payroll
    in period_from i pass a value '2 2018 monthly calendar'
    & in period_to i pass a vakue '10 2018 monthly calendar'
    so, i want all the elements name, sum(value) between these two parameters.
    if any one know please tell

    ReplyDelete