Oralce r12 HRMS SQL
Oralce r12 HRMS SQL
Oralce r12 HRMS SQL
lookup_type,
i.org_information_context, i.org_information1,
i.org_information2 , i.org_information3 , i.org_information4
from hr_all_organization_units o
, hr_organization_information i
, fnd_lookup_values l
where o.organization_id = i.organization_id
and i.org_information1 = l.lookup_code
and o.name like 'YRC%'
SELECT
ppf.employee_number,
ppf.full_name,
(ppa.EFFECTIVE_DATE)Payroll_Run_Date,
TP.PERIOD_NAME,
sum(decode(pec.CLASSIFICATION_NAME,'Earnings',to_number(rrv.result_value),0))
Earnings,
sum(decode(pec.CLASSIFICATION_NAME,'Involuntary
Deductions',to_number(rrv.result_value),0)) Involuntary_Deductions,
sum(decode(pec.CLASSIFICATION_NAME,'Employer
Charges',to_number(rrv.result_value),0))Employer_Charges,
sum(decode(pec.CLASSIFICATION_NAME,'Information',to_number(rrv.result_value),0))
Information
FROM per_people_x ppf,
per_assignments_x paf,
pay_assignment_actions pas,
pay_payroll_actions ppa,
pay_run_results rr,
pay_run_result_values rrv,
pay_element_types_f ety,
pay_input_values_F I,
PER_TIME_PERIODS TP,
PAY_ELEMENT_CLASSIFICATIONS_VL pec
WHERE ppf.person_id = paf.person_id
AND paf.assignment_id = pas.assignment_id
AND pas.assignment_action_id = rr.assignment_action_id
AND ppa.payroll_action_id = pas.payroll_action_id
AND rr.element_type_id = ety.element_type_id
AND i.element_type_id = ety.element_type_id
AND rrv.run_result_id = rr.run_result_id
AND rrv.input_value_id = i.input_value_id
and TP.TIME_PERIOD_ID = PPA.TIME_PERIOD_ID
and ety.CLASSIFICATION_ID=pec.CLASSIFICATION_ID
AND i.name = 'Pay Value'
and ppa.EFFECTIVE_DATE BETWEEN :p_st_effect_date AND :p_end_effect_date
group by ppf.employee_number,
ppf.person_id,
ppf.full_name,
ppa.TIME_PERIOD_ID,
ppa.EFFECTIVE_DATE,
TP.PERIOD_NAME,
paf.ORGANIZATION_ID
order by ppf.employee_number
and ppf.employee_number = nvl(:p_emp_number,ppf.employee_number)
select pes.ELEMENT_SET_NAME,petf.ELEMENT_NAME,petf.DESCRIPTION
from PAY_ELEMENT_SETS pes , PAY_ELEMENT_TYPE_RULES petr, PAY_ELEMENT_TYPES_F petf
where pes.ELEMENT_SET_ID = petr.ELEMENT_SET_ID
and petf.ELEMENT_TYPE_ID = petr.ELEMENT_TYPE_ID
Important Tables
There is a big list of oracle payroll tables. But these are main tables which every
technical consultant must know in detail. I have categorized these tables into
following three categories.
PAY_ELEMENT_TYPES_F
PAY_ELEMENT_ENTRIES_F
PAY_INPUT_VALUES_F
PAY_ELEMENT_LINKS_F
PER_ALL_ASSIGNMENTS_F PAAF,
PAY_ASSIGNMENT_ACTIONS PAA,
PAY_PAYROLL_ACTIONS PPA,
PER_ALL_PEOPLE_F PAPF,
PAY_ACTION_INFORMATION PAI
-Starts Here
select ppf.person_id
,period_name
,pet.element_name
,prrv.result_value
,ppos.person_id
from
per_people_f ppf
, apps.pay_element_types_f pet
, apps.pay_input_values_f piv
, apps.pay_run_result_values prrv
, apps.pay_run_results prr
, apps.pay_payroll_actions ppa
, apps.pay_assignment_actions paa
, apps.pay_element_classifications pec
, apps.per_time_periods ptp
, apps.per_assignments_f paf
, apps.pay_payrolls_f pay
, apps.per_periods_of_service ppos
where ppf.person_id = paf.person_id
and paf.assignment_id = paa.assignment_id
and piv.name = Pay Value
and prrv.input_value_id = piv.input_value_id
and piv.element_type_id = pet.element_type_id(+)
and prr.run_result_id = prrv.run_result_id
and paa.payroll_action_id = ppa.payroll_action_id
and prr.assignment_action_id = paa.assignment_action_id
and pet.element_type_id = prr.element_type_id
and ppa.action_type in (Q, R)
and pet.classification_id = pec.classification_id
and ptp.time_period_id = ppa.time_period_id(+)
and pay.payroll_id = paf.payroll_id
AND ppos.person_id = ppf.person_id
and ptp.payroll_id = paf.payroll_id
and nvl (ppa.date_earned, ppa.effective_date)
between pet.effective_start_date
and pet.effective_end_date
and nvl (ppa.date_earned, ppa.effective_date)
between piv.effective_start_date
and piv.effective_end_date
and nvl (ppa.date_earned, ppa.effective_date)
between paf.effective_start_date
and paf.effective_end_date
and nvl (ppa.date_earned, ppa.effective_date)
between ppf.effective_start_date
and ppf.effective_end_date
and ppf.employee_number = 600099
and upper(pet.element_name) like %COMMISSION%
and ptp.start_date between 01-JAN-2014 and 28-NOV-2015
and ptp.start_date between last_day(add_months(ppos.actual_termination_date,-7))+1
and last_day(add_months(ppos.actual_termination_date,-1))
http://oraclehrmsoverview.com/2015/04/01/oracle-payroll-process-locking-concepts/
Q1
PAY_ALL_PAYROLLS_F ALLPAYROLLDEO,
PAY_PAYROLL_REL_ACTIONS PAYRELACTIONEO,
PAY_PAY_RELATIONSHIPS_DN PAYRELATIONSHIPEO,
PER_PERSON_NAMES_F PERSONNAMEDEO,
PAY_TIME_PERIODS PAYTIMEPERIODSEO,
PER_ALL_PEOPLE_F PERSONEO,
HCM_LOOKUPS ACTIONTYPELOOKUP,
HCM_LOOKUPS ACTIONSTATUSLOOKUP,
PAY_PAYROLL_ACTIONS PAYROLLACTIONEO,
PAY_REQUESTS PRQ,
PAY_TASK_ACTIONS PTA,
PAY_TASKS_VL PT,
PER_LEGISLATIVE_DATA_GROUPS LDG
Q2
PAY_OBJECT_ACTIONS PAY_OBJ_ACT,
HCM_LOOKUPS ACTIONTYPELOOKUP,
HCM_LOOKUPS ACTIONSTATUSLOOKUP,
PAY_PAYROLL_ACTIONS PAYROLLACTIONEO,
PAY_REQUESTS PRQ,
PAY_TASK_ACTIONS PTA,
PAY_TASKS_VL PT,
PER_LEGISLATIVE_DATA_GROUPS LDG
Q3
PAY_TEMP_OBJECT_ACTIONS PAY_OBJ_ACT,
HCM_LOOKUPS ACTIONTYPELOOKUP,
HCM_LOOKUPS ACTIONSTATUSLOOKUP,
PAY_PAYROLL_ACTIONS PAYROLLACTIONEO,
PAY_REQUESTS PRQ,
PAY_TASK_ACTIONS PTA,
PAY_TASKS_VL PT,
PER_LEGISLATIVE_DATA_GROUPS LDG