Costing of Person – Query to fetch payroll relationships costing details

Oracle Fusion PayrollCostingBI PublisherSQL

Costing of Person – Query to fetch payroll relationships costing details

Returns the costing information stored at payroll relationship/Person/assignment level, shown against the worker’s assignment number. It is very useful for costing information reconciliation.

You may include more segments as per the configuration of your cost allocation key flexfield.

Payroll relationship level costing
select asg.assignment_number,
	   pdn.PAYROLL_RELATIONSHIP_NUMBER,
	   pcac.PROPORTION,
	   pcaf.effective_start_date,
	   pcaf.effective_end_date,
       pcac.source_sub_type,
       pcac.segment1,
       pcac.segment2,
       pcac.segment3
from PAY_COST_ALLOCATIONS_F pcaf
    ,PAY_COST_ALLOC_ACCOUNTS pcac
    ,per_all_assignments_m asg
    ,pay_pay_relationships_dn pdn
where pcaf.cost_allocation_record_id = pcac.cost_allocation_record_id
  and pcaf.source_type = 'PREL'
  and asg.person_id = pdn.person_id
  and asg.effective_latest_change = 'Y'
  and asg.assignment_type = 'E'
  and pdn.PAYROLL_RELATIONSHIP_NUMBER = nvl(:p_relationship_number,pdn.PAYROLL_RELATIONSHIP_NUMBER)
  and trunc(sysdate) between asg.effective_start_date and asg.effective_end_date
  and trunc(SYSDATE) BETWEEN pcaf.effective_start_date AND pcaf.effective_end_date
  and pcaf.payroll_relationship_id = pdn.payroll_relationship_id;

Costing of Person – Query to fetch payroll relationships assignment costing details

Returns the costing information stored at payroll relationship/Person/assignment level, shown against the worker’s assignment number. It is very useful for costing information reconciliation.

If you have stored costing information at assignment level, replace the source_type value with ASG. You may include more segments as per the configuration of your cost allocation key flexfield.

Payroll relationship level costing
select asg.assignment_number,
	   pdn.PAYROLL_RELATIONSHIP_NUMBER,
	   pcac.PROPORTION,	   
	   pcaf.effective_start_date,
	   pcaf.effective_end_date,
       pcac.source_sub_type,
       pcac.segment1,
       pcac.segment2,
       pcac.segment3
from PAY_COST_ALLOCATIONS_F pcaf
    ,PAY_COST_ALLOC_ACCOUNTS pcac
    ,per_all_assignments_m asg
    ,pay_pay_relationships_dn pdn
where pcaf.cost_allocation_record_id = pcac.cost_allocation_record_id
  and pcaf.source_type = 'ASG'
  and asg.person_id = pdn.person_id
  and asg.effective_latest_change = 'Y'
  and asg.assignment_type = 'E'
  and asg.assignment_number = nvl(:p_assignment_number,asg.assignment_number)
  and trunc(sysdate) between asg.effective_start_date and asg.effective_end_date
  and trunc(SYSDATE) BETWEEN pcaf.effective_start_date AND pcaf.effective_end_date
  and pcaf.payroll_relationship_id = pdn.payroll_relationship_id;

Tips for using the queries

  • Create a BI Publisher data model, add a new SQL Query data set that uses the HCM application database as its data source, and paste the query in. Remove the trailing semicolon as the data model editor rejects it.
  • Match the segment columns to your cost allocation key flexfield structure, as the number of segments differs between implementations.

Leave a Comment