You are on page 1of 71

HRMS Payroll in Oracle Apps Flow

This is valid only when the core HRMS module has already been set up. The things that we are
going to see are

Elements

Salary Basis

Mode of Payment

Payroll

Overview
Your Salary is Fixed + Variables + Others = Gross CTC
In this you will have a Fixed Earnings that is your fixed salary, Basic, HRA and you will also
have fixed Deductions like PFA etc. The Variables is something that you will get temporarily it is
not fixed like Bonus((Earnings)you will get once or twice), LOP(Loss of Pay Deductions for a
particular period).
In Oracle apps we to calculate the Salary so we need the details of their Position, Job, Grade
Depending of employer. Depending on this we fix the salary according to grade wise
So in order to calculate the payroll we need the Assignments in oracle apps to be filled which is a
mandatory. This Assignment tab consists of some useful information regarding the Salary such as
Grade Job, Organization People
General introduction regarding the HRMS for payroll
Employees details will be in the People which contains the employee details whether he is hired
of Applicant or Employment.
The Navigation is
Global HRMS Manager People Enter and Maintain

Click on Assignment tab for the information like Position, Job, Grade, Salary Information,
Supervisor

Now we will view the Payroll part in Oracle Apps

Elements

The first thing to have payroll is to have Elements.


Go to the Navigation
Global HRMS Total Compensation Basic Element Description

As in the above Image we see there are three things important


1. Classification This is important as this decides that it is going to be a Earning or
Deductions
Here on seeing the important is
Earnings, Voluntary Deductions, Involuntary Deductions
Earnings is known that what we earned, Voluntary Deductions are that when we apply for a loan
from salary it gets deducted so this is voluntary and Involuntary is something like the PFA or
service charges
2. Type
This is Important because we declare something to be Recurring is that it adds all the time on
every month. Whereas Nonrecurring just occurs one or for the defined period
3.Input Values

Input Values Defines that do you want in Money or in Number. Just consider the situation if I
want to give compensation for over time I can give it as in Number of Days so I choose number
or compensation as money.

After creating an element we have to create a Elements link

This you have to link to the payroll in order to get it Integerated. Here select the element name
and select the Eligiblity criteria. Now image when you attach this element you have created
Imaging you have created a Earning which is possible above the Grade 4 level. So the Element
name has to set to the valid grades. You can also select which costing has to go for financial
purposes.
Salary Basis

Here you can select the salary which is month wise or date wise or hour wise. Just imagine you
have a company and recruited a person with 250000 per anum. So for permanent employee you
give for monthly wise and for a contract employee you give it weekly. So you will select on what
basis you will give the salary.
Mode Of Payment (Payment Method)
Go to the Navigation
Global HRMS Payroll Payment Methods

A company will give their salary by bank account or by check or some by cash. When we define
that we will pay their payment the a method it gets registered. We can also fill some details like
the bank details and others.

Now to View the Payroll Just click the Description to have a full description.
Here we can see that we have many payment methods on clicking Valid Payment Methods and
we can set default.

Now Just go to the Navigation is


Global HRMS Manager People Enter and Maintain

Now you can Click on Enter and Maintain and then click Assignment and here you can see that
this person can have different payroll and the salary basis. On clicking the Entries Tab you will
be able to see the entries you have entered in the screen

Now to process this Functional people will have Fast formula to define how the payroll should
be integrated and they have the payment logic in this Fast formula. After running the fast formula
we will be able to see the Formula results.
Navigation is
Global HRMS Manager Total Compensation Basic Write Formula and Formula results
After Defining the Fast formulas now we have to run the concurrent for processing payroll
The concurrent will be Payroll Run or Quick Pay
Payroll Intergration API Absence and Batch Element Entry

Overview

API is a way to insert the data from custom table to Oracle seeded table like interface
in oracle apps.
To program a API or Interface we have to know the front end and where the data gets
saved(tables). So it is always a good approach to know the requirement, flow and the
backend.
This area which we are going to deal is payroll Integration. Here we get the Data from the
custom table and then we insert into Oracle seeded table by using the API(Application

Programmable Interface). The custom table is that in OTL(Oracle Time and Labour) which is a
custom module designed for moiss.
Bascially a Interface or API is used to load a bulk of data to the Oracle Seeded table. The

hr_person_absence_api API inserts absence data bulk to the table and


pay_batch_element_entry_api API Inserts a bulk of elements based on assignment set.
This groups as Inputs that has to be applied for elements.
Here I have developed a package which has both the functionalities of Absence and Batch
Element Entry
APIs are

pay_batch_element_entry_api pay_batch_headers, pay_batch_lines,


pay_batch_control_totals
hr_person_absence_api

Flow
PAY_BATCH_ELEMENT_ENTRY_API
pay_batch_element_entry_api API inserts data in a batch depending on group of
elements or assignment set.
The Navigation is
Mass Information Exchange(MIX) Batch Element Entry

The Navigation is
Mass Information Exchange(MIX) Batch Element Entry Element Lines

HR_PERSON_ABSENCE_API
The Navigation is
Global HRMS Manager People Enter and Maintain Others Absence

In oracle apps for Integrating the custom data to oracle absence table we have the
HR_PERSON_ABSENCE_APIAPIto delete or to update we can also use this API.

Before programming this API and moving the data from custom table it is

This below screenshot is a example of a sick leave for a person

Queries Related to HR_PERSON_ABSENCE_API

To Get Employee Details from PER_ALL_PEOPLE_Ftable

SELECT*
FROMPER_ALL_PEOPLE_FPAPF,PER_ALL_ASSIGNMENTS_FPAAF
WHEREPAPF.EMPLOYEE_NUMBER=2108
ANDPAPF.CURRENT_EMPLOYEE_FLAG=Y
ANDPAPF.EMPLOYEE_NUMBERISNOTNULL
ANDPAAF.PERSON_ID=PAPF.PERSON_ID
ANDSYSDATEBETWEENPAAF.EFFECTIVE_START_DATE
ANDPAAF.EFFECTIVE_END_DATE;

To Test the API whether it is working or not just click on the API and press F4 now a
window gets opened. Just Click on the top on the option Toggle Spec or Toggle Body
now take the specification and body seperate compile and check whether it is working
or not

To Get Employees Absence Details from PER_ALL_PEOPLE_Ftable


SELECTPAPF.PERSON_ID,
PAPF.EFFECTIVE_START_DATE,
PAPF.EFFECTIVE_END_DATE,
PAPF.LAST_NAME,
PAV.CATEGORY_MEANING
FROMPER_ALL_PEOPLE_FPAPF,
PER_ALL_ASSIGNMENTS_FPAAF,
PER_ABSENCE_ATTENDANCES_VPAV
WHEREPAPF.EMPLOYEE_NUMBER=2108
ANDPAPF.CURRENT_EMPLOYEE_FLAG=Y
ANDPAPF.EMPLOYEE_NUMBERISNOTNULL
ANDPAAF.PERSON_ID=PAPF.PERSON_ID

ANDSYSDATEBETWEENPAAF.EFFECTIVE_START_DATE
ANDPAAF.EFFECTIVE_END_DATE
ANDPAV.PERSON_ID=PAPF.PERSON_ID;

Queries related to pay_batch_element_entry_api


Getting the Element Type Id and its Information

select*fromPAY_ELEMENT_TYPES_Fwhereelement_name=Overtime
OTMSpecialInputs

SELECT*
FROMPAY_ELEMENT_TYPES_F
WHEREelement_name=HolidayPaySpecialInputs;
SELECT*
FROMPAY_ELEMENT_TYPES_F
WHEREelement_name=ProductionBonus;

Getting the info of Batches


SELECTPBH.BATCH_NAMEFROMPAY_BATCH_HEADERSPBH,PAY_BATCH_LINES
PBLWHEREPBH.BATCH_ID=PBL.BATCH_ID;
SELECTPBL.*,PBH.*FROMPAY_BATCH_HEADERSPBH,PAY_BATCH_LINES
PBLWHEREPBH.BATCH_ID=PBL.BATCH_IDANDBATCH_NAMELIKEMY%TEST
%;

Getting the Employee details from custom table


SELECTPAPF.PERSON_ID,

PAPF.EFFECTIVE_START_DATE,
PAPF.EFFECTIVE_END_DATE,
PAPF.LAST_NAME,
PAAF.ASSIGNMENT_ID
FROMPER_ALL_PEOPLE_FPAPF,
PER_ALL_ASSIGNMENTS_FPAAF
WHEREPAPF.EMPLOYEE_NUMBER=2108
ANDPAPF.CURRENT_EMPLOYEE_FLAG=Y
ANDPAPF.EMPLOYEE_NUMBERISNOTNULL
ANDPAAF.PERSON_ID=PAPF.PERSON_ID
ANDSYSDATEBETWEENPAAF.EFFECTIVE_START_DATE
ANDPAAF.EFFECTIVE_END_DATE;

To Check Whether the data is Inserted or not


SELECTPBL.*,PBH.*
FROMPAY_BATCH_HEADERSPBH,PAY_BATCH_LINESPBL
WHEREPBH.BATCH_ID=PBL.BATCH_IDANDBATCH_NAMELIKE%WORKSHOP
%;

SELECTPBL.*,PBH.*
FROMPAY_BATCH_HEADERSPBH,PAY_BATCH_LINESPBL
WHEREPBH.BATCH_ID=PBL.BATCH_IDANDBATCH_NAMELIKE%HOLI%;

SELECTPBL.*,PBH.*
FROMPAY_BATCH_HEADERSPBH,PAY_BATCH_LINESPBL
WHEREPBH.BATCH_ID=PBL.BATCH_IDANDBATCH_NAME
LIKE%MOISS_OVERTIME%;

Insert Statements

INSERTINTOxxtest_emp_attendance(employee_id,
att_date,
holiday_overtime,
created_by,
creation_date,
day_type)
VALUES(113,
TO_DATE(01/02/2012,mm/dd/yyyy),
5,
1310,
TO_DATE(01/19/2014,mm/dd/yyyy),
WD);

INSERTINTOxxtest_emp_attendance(employee_id,
att_date,
workday_overtime,
created_by,
creation_date,
day_type)
VALUES(113,
TO_DATE(01/03/2012,mm/dd/yyyy),
5,
1310,
TO_DATE(01/19/2014,mm/dd/yyyy),
WD);

INSERTINTOxxtest_emp_attendance(employee_id,
att_date,
workshop_bonus,
created_by,
creation_date,
day_type)

VALUES(113,
TO_DATE(01/04/2012,mm/dd/yyyy),
5,
1310,
TO_DATE(01/19/2014,mm/dd/yyyy),
WD);

INSERTINTOxxtest_emp_attendance(employee_id,
att_date,
rig_bonus,
created_by,
creation_date,
day_type)
VALUES(113,
TO_DATE(01/05/2012,mm/dd/yyyy),
4,
1310,
TO_DATE(01/19/2014,mm/dd/yyyy),
WD);

Testing Queries

select*fromxxtest_emp_attendance

General Util Queries from Oracle Apps.

selecttextActual_Queryfromuser_viewswhere
view_name=PAY_ELEMENT_TYPES_DENORM_V;

Program using APIs


Spec of API
CREATEORREPLACEPACKAGEMOISS_PAYROLL_INT_API
IS
PROCEDUREMOISS_ABSENCE_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
EMP_NONUMBER,
START_DATE_VVARCHAR2,
END_DATE_VVARCHAR2
);

PROCEDUREMOISS_BONUS_OVERTIME_ALL_E(ERRBUFOUTVARCHAR2,

RETCODEOUTNUMBER,
START_DATE_VVARCHAR2,
END_DATE_VVARCHAR2
);

PROCEDUREMOISS_WORKDAY_OVERTIME_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
START_DATE_VVARCHAR2,
END_DATE_VVARCHAR2
);

PROCEDUREMOISS_HOLIDAY_OVERTIME_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
START_DATE_VDATE,
END_DATE_VDATE
);

PROCEDUREMOISS_WORKSHOP_BONUS_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
START_DATE_VDATE,
END_DATE_VDATE
);

PROCEDUREMOISS_RIG_BONUS_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
START_DATE_VDATE,
END_DATE_VDATE
);
END;

Body of API

/*Formattedon1/22/201411:22:14AM(QP5v5.114.809.3010)*/
CREATEORREPLACEPACKAGEBODYMOISS_PAYROLL_INT_API
AS
PROCEDUREMOISS_ABSENCE_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
EMP_NONUMBER,
START_DATE_VVARCHAR2,

END_DATE_VVARCHAR2
)
IS
CURSORc
IS
SELECTDISTINCTEMPLOYEE_ID,ATT_DATE
FROMmoiss_emp_attendance
WHEREday_type=AB
ANDATT_DATEBETWEENTRUNC(TO_DATE(START_DATE_V,
RRRR/MM/DDHH24:MI:SS))
ANDTRUNC(TO_DATE(END_DATE_V,RRRR/MM/DDHH24:MI:SS))
ANDemployee_id=EMP_NO;

SELECT*FROMmoiss_emp_attendance

x_absence_daysnumber;
x_absence_hoursnumber:=10;
:=ABS_HOUR_V;Ifapplicablewehavetoinclude
x_absence_attendance_type_idnumber;ABSENCEATTENDANCETYPEID
:=ATT_TYPE_ID_V;Ifapplicablewehavetoinclude
x_absence_attendance_idnumber;
x_object_version_numbernumber;
x_occurrencenumber;

x_dur_dys_less_warningboolean;
x_dur_hrs_less_warningboolean;
x_exceeds_pto_entit_warningboolean;
x_exceeds_run_total_warningboolean;
x_abs_overlap_warningboolean;
x_abs_day_after_warningboolean;
x_dur_overwritten_warningboolean;
x_con_countnumber;
BEGIN
retcode:=0;
errbuf:=Success;
x_con_count:=0;
fnd_file.put_line(fnd_file.LOG,Start);

DBMS_OUTPUT.PUT_LINE(
THEvaluesAREIS||START_DATE_V||END_DATE_V
);

FND_FILE.PUT_LINE(fnd_file.LOG,)

TokeepcheckfortheConcurrent
x_con_count:=0;

Countstheloopofnumberthatistotalnumberofloopsthat
hastobegoing

fnd_global.apps_initialize(user_id=>fnd_global.user_id,
resp_id=>fnd_global.resp_id,
resp_appl_id=>fnd_global.resp_appl_id);

SELECTabsence_attendance_type_id
INTOx_absence_attendance_type_id
FROMper_absence_attendance_types
WHEREbusiness_group_id=fnd_global.per_business_group_id
ANDnameLIKE%Personal%
ANDROWNUM=1;

FORIINC
LOOP
hr_person_absence_api.create_person_absence(
p_validate=>FALSE,
p_effective_date=>I.ATT_DATE,
p_person_id=>I.EMPLOYEE_ID,
p_business_group_id=>fnd_global.per_business_group_id

,
101,
p_absence_attendance_type_id=>x_absence_attendance_type_id,
71,VACATIONLEAVE
p_date_projected_start=>I.ATT_DATE,
p_time_projected_start=>NULL,
Ifapplicablewehavetoinclude
p_date_projected_end=>I.ATT_DATE,
p_time_projected_end=>NULL,
Ifapplicablewehavetoinclude
p_date_start=>I.ATT_DATE,
p_time_start=>NULL,
Ifapplicablewehavetoinclude18:00,
p_date_end=>I.ATT_DATE,
p_time_end=>NULL,
Ifapplicablewehavetoinclude20:00,
p_date_start=>sysdate,
p_date_end=>sysdate+1,
p_absence_days=>x_absence_days,
p_absence_hours=>x_absence_hours,
p_absence_attendance_id=>x_absence_attendance_id,
p_object_version_number=>x_object_version_number,
p_occurrence=>x_occurrence,

p_dur_dys_less_warning=>x_dur_dys_less_warning,
p_dur_hrs_less_warning=>x_dur_hrs_less_warning,
p_exceeds_pto_entit_warning=>x_exceeds_pto_entit_warning,
p_exceeds_run_total_warning=>x_exceeds_run_total_warning,
p_abs_overlap_warning=>x_abs_overlap_warning,
p_abs_day_after_warning=>x_abs_day_after_warning,
p_dur_overwritten_warning=>x_dur_overwritten_warning
);

x_con_count:=1+x_con_count;
fnd_file.put_line(
fnd_file.LOG,
x_con_count
||
||EmployeeID
||I.EMPLOYEE_ID
||AttDate
||I.ATT_DATE
);
ENDLOOP;

IFx_con_count=0
THEN

fnd_file.put_line(fnd_file.LOG,NoDataFound);
ENDIF;

COMMIT;
EXCEPTION
WHENNO_DATA_FOUND
THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=
NODATAFOUND
||SUBSTR(SQLERRM,1,1000)
||DBMS_UTILITY.format_error_backtrace;
WAR_V:=errbuf;
fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace
);
WHENOTHERS
THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=

ErrorinPayrollABSENCEIntegration
||SUBSTR(SQLERRM,1,1000)
||DBMS_UTILITY.format_error_backtrace;
fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace
);

WAR_V:=errbuf;
ENDMOISS_ABSENCE_PAYROLL;

PROCEDUREMOISS_BONUS_OVERTIME_ALL_E(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
START_DATE_VVARCHAR2,
END_DATE_VVARCHAR2
)
IS
ERRBUFVARCHAR2(100),
RETCODEOUTNUMBER,
BEGIN

fnd_file.put_line(fnd_file.LOG,Procedure1Started);
MOISS_PAYROLL_INT_API.MOISS_WORKDAY_OVERTIME_PAYROLL(ERRBUF,
RETCODE,START_DATE_V,END_DATE_V);
fnd_file.put_line(fnd_file.LOG,);
MOISS_PAYROLL_INT_API.MOISS_HOLIDAY_OVERTIME_PAYROLL(ERRBUF,
RETCODE,START_DATE_V,END_DATE_V);
MOISS_PAYROLL_INT_API.MOISS_WORKSHOP_BONUS_PAYROLL(ERRBUF,
RETCODE,START_DATE_V,END_DATE_V);
MOISS_PAYROLL_INT_API.MOISS_RIG_BONUS_PAYROLL(ERRBUF,RETCODE,
START_DATE_V,END_DATE_V);
fnd_file.put_line(fnd_file.LOG,Procedure1Ended);
EXCEPTION
whenothersthen
fnd_file.put_line(fnd_file.LOG,ExeEnv||
DBMS_UTILITY.format_error_backtrace);
ENDMOISS_BONUS_OVERTIME_ALL_E;

PROCEDUREMOISS_WORKDAY_OVERTIME_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
START_DATE_VVARCHAR2,
END_DATE_VVARCHAR2
)
IS

v_batch_idvarchar2(60);
x_batch_idnumber:=0;
x_ver_nonumber;
x_batch_line_idnumber;
g_ver_nonumber;
x_ver_no_1number;
x_con_countnumber;
x_element_type_idnumber;

CURSORc
IS
SELECTDISTINCTatt_date,
WORKDAY_OVERTIME,
PAF.ASSIGNMENT_ID,
paf.assignment_number
FROMmoiss_emp_attendancemea,per_assignments_fpaf
WHEREpaf.person_id=mea.employee_id
ANDWORKDAY_OVERTIMEISNOTNULL
ANDATT_DATEBETWEENSTART_DATE_VANDEND_DATE_V;
BEGIN
retcode:=0;
errbuf:=Success;
x_con_count:=0;

fnd_file.put_line(fnd_file.LOG,Start);

DBMS_OUTPUT.PUT_LINE(
THEvaluesAREIS||START_DATE_V||END_DATE_V
);

FND_FILE.PUT_LINE(fnd_file.LOG,)

TokeepcheckfortheConcurrent
x_con_count:=0;
Countstheloopofnumberthatistotalnumberofloopsthat
hastobegoing

fnd_global.apps_initialize(user_id=>fnd_global.user_id,
resp_id=>fnd_global.resp_id,
resp_appl_id=>fnd_global.resp_appl_id);

SELECTTO_CHAR(SYSDATE)INTOv_batch_idFROMDUAL;

SELECTELEMENT_TYPE_ID
INTOx_element_type_id

FROMPAY_ELEMENT_TYPES_F
WHEREelement_nameLIKE%OvertimeOTMSpecialInputs%
ANDROWNUM=1;

FORiINc
LOOP
pay_batch_element_entry_api.create_batch_header(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_name=>MOISS_OVERTIME||v_batch_id,
p_batch_status=>U,unprocessed
p_business_group_id=>fnd_global.per_business_group_id,
202,101business_group_id
p_action_if_exists=>I,
i=createnewentry,u=updateentry
p_batch_reference=>NULL,
g_user_name||||to_char(sysdate,ddmonyyyy)
p_batch_source=>NULL,nameofthebatch
p_comments=>NULL,
p_date_effective_changes=>NULL,
p_purge_after_transfer=>N,
p_reject_if_future_changes=>Y,
p_batch_id=>x_batch_id,

p_object_version_number=>g_ver_no,
p_reject_if_results_exists=>Y,
p_purge_after_rollback=>N,
p_batch_type=>NULL,
p_reject_entry_not_removed=>N,
p_rollback_entry_updates=>N
);
DBMS_OUTPUT.put_line(
v_batch_id||v_batch_id||x_batch_id||g_ver_no
);
pay_batch_element_entry_api.create_batch_line(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_id=>x_batch_id,
p_assignment_id=>i.ASSIGNMENT_ID,
p_assignment_number=>i.assignment_number,
p_batch_sequence=>NULL,
p_effective_date=>SYSDATE,l_effective_date
p_element_type_id=>x_element_type_id,
OvertimeOTMSpecialInputs
p_entry_type=>E,
p_value_1=>i.WORKDAY_OVERTIME,
holidayovertimehrs

p_value_2=>15,AssumingValue
regularovertimehrs,
p_batch_line_id=>x_batch_line_id,
p_object_version_number=>x_ver_no_1
);

x_con_count:=1+x_con_count;
fnd_file.put_line(
fnd_file.LOG,
x_con_count||||EmployeeID||I.WORKDAY_OVERTIME||
I.ASSIGNMENT_ID||I.assignment_number||AttDate
||I.ATT_DATE
);
ENDLOOP;

IFx_con_count=0
THEN
fnd_file.put_line(fnd_file.LOG,NoDataFound);
ENDIF;

COMMIT;
EXCEPTION
WHENNO_DATA_FOUND

THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=
NODATAFOUND
||SUBSTR(SQLERRM,1,1000)
||DBMS_UTILITY.format_error_backtrace;
WAR_V:=errbuf;
fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace
);
WHENOTHERS
THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=
ErrorinPayrollABSENCEIntegration
||SUBSTR(SQLERRM,1,1000)
||DBMS_UTILITY.format_error_backtrace;
fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace

);

WAR_V:=errbuf;
END;

PROCEDUREMOISS_HOLIDAY_OVERTIME_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
START_DATE_VDATE,
END_DATE_VDATE
)
IS
v_batch_idVARCHAR2(60);
x_batch_idnumber;
x_ver_nonumber;
x_batch_line_idnumber;
g_ver_nonumber;
x_ver_no_1number;
x_con_countnumber;

x_element_type_idnumber;

CURSORc
IS
SELECTDISTINCTatt_date,
HOLIDAY_OVERTIME,
PAF.ASSIGNMENT_ID,
paf.assignment_number
FROMmoiss_emp_attendancemea,per_assignments_fpaf
WHEREpaf.person_id=mea.employee_id
ANDMEA.HOLIDAY_OVERTIMEISNOTNULL
ANDATT_DATEBETWEENSTART_DATE_VANDEND_DATE_V;
BEGIN
retcode:=0;
errbuf:=Success;
x_con_count:=0;
fnd_file.put_line(fnd_file.LOG,Start);

DBMS_OUTPUT.PUT_LINE(
THEvaluesAREIS||START_DATE_V||END_DATE_V
);

FND_FILE.PUT_LINE(fnd_file.LOG,)

TokeepcheckfortheConcurrent
x_con_count:=0;
Countstheloopofnumberthatistotalnumberofloopsthat
hastobegoing

fnd_global.apps_initialize(user_id=>fnd_global.user_id,
resp_id=>fnd_global.resp_id,
resp_appl_id=>fnd_global.resp_appl_id);

SELECTTO_CHAR(SYSDATE)INTOv_batch_idFROMDUAL;

SELECTELEMENT_TYPE_ID
INTOx_element_type_id
FROMPAY_ELEMENT_TYPES_F
WHEREelement_nameLIKE%OTLHolidayPay%ANDROWNUM=1;

FORiINc
LOOP

pay_batch_element_entry_api.create_batch_header(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_name=>M_HOLI_OVERTIME||v_batch_id,
p_batch_status=>U,unprocessed
p_business_group_id=>fnd_global.per_business_group_id,
202,101business_group_id
p_action_if_exists=>I,
i=createnewentry,u=updateentry
p_batch_reference=>NULL,
g_user_name||||to_char(sysdate,ddmonyyyy)
p_batch_source=>NULL,nameofthebatch
p_comments=>NULL,
p_date_effective_changes=>NULL,
p_purge_after_transfer=>N,
p_reject_if_future_changes=>Y,
p_batch_id=>x_batch_id,
p_object_version_number=>g_ver_no,
p_reject_if_results_exists=>Y,
p_purge_after_rollback=>N,
p_batch_type=>NULL,
p_reject_entry_not_removed=>N,
p_rollback_entry_updates=>N

);
DBMS_OUTPUT.put_line(
v_batch_id||v_batch_id||x_batch_id||g_ver_no
);
pay_batch_element_entry_api.create_batch_line(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_id=>x_batch_id,
p_assignment_id=>i.ASSIGNMENT_ID,
p_assignment_number=>i.assignment_number,
p_batch_sequence=>NULL,
p_effective_date=>SYSDATE,l_effective_date
p_element_type_id=>x_element_type_id,
EarningspaidforHolidaystraighttime)
p_entry_type=>E,
p_value_1=>i.HOLIDAY_OVERTIME,
holidayovertimehrs
p_value_2=>15,
AssumingValue(Valuestobenoted)
regularovertimehrs,
p_batch_line_id=>x_batch_line_id,
p_object_version_number=>x_ver_no_1
);

x_con_count:=1+x_con_count;
fnd_file.put_line(
fnd_file.LOG,
x_con_count||||EmployeeID||I.HOLIDAY_OVERTIME||
I.ASSIGNMENT_ID||I.assignment_number||AttDate
||I.ATT_DATE
);
ENDLOOP;

IFx_con_count=0
THEN
fnd_file.put_line(fnd_file.LOG,NoDataFound);
ENDIF;

COMMIT;
EXCEPTION
WHENNO_DATA_FOUND
THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=
NODATAFOUND
||SUBSTR(SQLERRM,1,1000)

||DBMS_UTILITY.format_error_backtrace;
WAR_V:=errbuf;
fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace
);
WHENOTHERS
THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=
ErrorinPayrollABSENCEIntegration
||SUBSTR(SQLERRM,1,1000)
||DBMS_UTILITY.format_error_backtrace;
fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace
);

WAR_V:=errbuf;
END;

PROCEDUREMOISS_WORKSHOP_BONUS_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
START_DATE_VDATE,
END_DATE_VDATE
)
IS
v_batch_idVARCHAR2(60);
x_batch_idnumber;
x_ver_nonumber;
x_batch_line_idnumber;
g_ver_nonumber;
x_ver_no_1number;
x_con_countnumber;
x_element_type_idnumber;

CURSORc
IS
SELECTDISTINCTatt_date,
WORKSHOP_BONUS,
PAF.ASSIGNMENT_ID,

paf.assignment_number
FROMmoiss_emp_attendancemea,per_assignments_fpaf
WHEREpaf.person_id=mea.employee_id
ANDMEA.WORKSHOP_BONUSISNOTNULL
ANDATT_DATEBETWEENSTART_DATE_VANDEND_DATE_V;
BEGIN
retcode:=0;
errbuf:=Success;
x_con_count:=0;
fnd_file.put_line(fnd_file.LOG,Start);

DBMS_OUTPUT.PUT_LINE(
THEvaluesAREIS||START_DATE_V||END_DATE_V
);

FND_FILE.PUT_LINE(fnd_file.LOG,)

TokeepcheckfortheConcurrent
x_con_count:=0;
Countstheloopofnumberthatistotalnumberofloopsthat
hastobegoing

fnd_global.apps_initialize(user_id=>fnd_global.user_id,

resp_id=>fnd_global.resp_id,
resp_appl_id=>fnd_global.resp_appl_id);
SELECTTO_CHAR(SYSDATE)INTOv_batch_idFROMDUAL;

SELECTELEMENT_TYPE_ID
INTOx_element_type_id
FROMPAY_ELEMENT_TYPES_F
WHEREelement_nameLIKE%ProductionBonus%ANDROWNUM=1;
FORiINc
LOOP
pay_batch_element_entry_api.create_batch_header(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_name=>WORKSHOP_BONUS||v_batch_id,
p_batch_status=>U,unprocessed
p_business_group_id=>fnd_global.per_business_group_id,
202,101business_group_id
p_action_if_exists=>I,
i=createnewentry,u=updateentry
p_batch_reference=>NULL,
g_user_name||||to_char(sysdate,ddmonyyyy)
p_batch_source=>NULL,nameofthebatch
p_comments=>NULL,

p_date_effective_changes=>NULL,
p_purge_after_transfer=>N,
p_reject_if_future_changes=>Y,
p_batch_id=>x_batch_id,
p_object_version_number=>g_ver_no,
p_reject_if_results_exists=>Y,
p_purge_after_rollback=>N,
p_batch_type=>NULL,
p_reject_entry_not_removed=>N,
p_rollback_entry_updates=>N
);
DBMS_OUTPUT.put_line(
v_batch_id||v_batch_id||x_batch_id||g_ver_no
);
pay_batch_element_entry_api.create_batch_line(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_id=>x_batch_id,
p_assignment_id=>i.ASSIGNMENT_ID,
p_assignment_number=>i.assignment_number,
p_batch_sequence=>NULL,
p_effective_date=>SYSDATE,l_effective_date
p_element_type_id=>x_element_type_id,ProductionBonus

p_entry_type=>E,
p_value_1=>i.WORKSHOP_BONUS,
holidayovertimehrs
p_value_2=>15,
AssumingValue(Valuestobenoted)
regularovertimehrs,
p_batch_line_id=>x_batch_line_id,
p_object_version_number=>x_ver_no_1
);
x_con_count:=1+x_con_count;
fnd_file.put_line(
fnd_file.LOG,
x_con_count||||EmployeeID||I.WORKSHOP_BONUS||
I.ASSIGNMENT_ID||I.assignment_number||AttDate
||I.ATT_DATE
);
ENDLOOP;

IFx_con_count=0
THEN
fnd_file.put_line(fnd_file.LOG,NoDataFound);
ENDIF;

COMMIT;
EXCEPTION
WHENNO_DATA_FOUND
THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=
NODATAFOUND
||SUBSTR(SQLERRM,1,1000)
||DBMS_UTILITY.format_error_backtrace;
WAR_V:=errbuf;
fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace
);
WHENOTHERS
THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=
ErrorinPayrollABSENCEIntegration
||SUBSTR(SQLERRM,1,1000)
||DBMS_UTILITY.format_error_backtrace;

fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace
);

WAR_V:=errbuf;
END;

PROCEDUREMOISS_RIG_BONUS_PAYROLL(ERRBUFOUTVARCHAR2,
RETCODEOUTNUMBER,
START_DATE_VDATE,
END_DATE_VDATE
)
IS
v_batch_idVARCHAR2(60);
x_batch_idnumber;
x_ver_nonumber;
x_batch_line_idnumber;
g_ver_nonumber;
x_ver_no_1number;
x_con_countnumber;
x_element_type_idnumber;

CURSORc
IS
SELECTDISTINCTatt_date,
RIG_BONUS,
PAF.ASSIGNMENT_ID,
paf.assignment_number
FROMmoiss_emp_attendancemea,per_assignments_fpaf
WHEREpaf.person_id=mea.employee_id
ANDMEA.WORKSHOP_BONUSISNOTNULL
ANDATT_DATEBETWEENSTART_DATE_VANDEND_DATE_V;
BEGIN
retcode:=0;
errbuf:=Success;
x_con_count:=0;
fnd_file.put_line(fnd_file.LOG,Start);

DBMS_OUTPUT.PUT_LINE(
THEvaluesAREIS||START_DATE_V||END_DATE_V
);

FND_FILE.PUT_LINE(fnd_file.LOG,)

TokeepcheckfortheConcurrent

x_con_count:=0;
Countstheloopofnumberthatistotalnumberofloopsthat
hastobegoing

fnd_global.apps_initialize(user_id=>fnd_global.user_id,
resp_id=>fnd_global.resp_id,
resp_appl_id=>fnd_global.resp_appl_id);
SELECTTO_CHAR(SYSDATE)INTOv_batch_idFROMDUAL;
SELECTELEMENT_TYPE_ID
INTOx_element_type_id
FROMPAY_ELEMENT_TYPES_F
WHEREelement_nameLIKE%ProductionBonus%ANDROWNUM=1;
FORiINc
LOOP
pay_batch_element_entry_api.create_batch_header(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_name=>RIG_BONUS||v_batch_id,
p_batch_status=>U,unprocessed
p_business_group_id=>fnd_global.per_business_group_id,
202,101business_group_id
p_action_if_exists=>I,
i=createnewentry,u=updateentry

p_batch_reference=>NULL,
g_user_name||||to_char(sysdate,ddmonyyyy)
p_batch_source=>NULL,nameofthebatch
p_comments=>NULL,
p_date_effective_changes=>NULL,
p_purge_after_transfer=>N,
p_reject_if_future_changes=>Y,
p_batch_id=>x_batch_id,
p_object_version_number=>g_ver_no,
p_reject_if_results_exists=>Y,
p_purge_after_rollback=>N,
p_batch_type=>NULL,
p_reject_entry_not_removed=>N,
p_rollback_entry_updates=>N
);
DBMS_OUTPUT.put_line(
v_batch_id||v_batch_id||x_batch_id||g_ver_no
);
pay_batch_element_entry_api.create_batch_line(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_id=>x_batch_id,
p_assignment_id=>i.ASSIGNMENT_ID,

p_assignment_number=>i.assignment_number,
p_batch_sequence=>NULL,
p_effective_date=>SYSDATE,l_effective_date
p_element_type_id=>x_element_type_id,
ProductionBonus(HastobechangedforRigBonus)
p_entry_type=>E,
p_value_1=>i.RIG_BONUS,
holidayovertimehrs
p_value_2=>15,
AssumingValue(Valuestobenoted)
regularovertimehrs,
p_batch_line_id=>x_batch_line_id,
p_object_version_number=>x_ver_no_1
);
x_con_count:=1+x_con_count;
fnd_file.put_line(
fnd_file.LOG,
x_con_count||||EmployeeID||I.RIG_BONUS||I.
ASSIGNMENT_ID||I.assignment_number||AttDate||
I.
ATT_DATE);
ENDLOOP;
IFx_con_count=0

THEN
fnd_file.put_line(fnd_file.LOG,NoDataFound);
ENDIF;
COMMIT;
EXCEPTION
WHENNO_DATA_FOUND
THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=
NODATAFOUND
||SUBSTR(SQLERRM,1,1000)
||DBMS_UTILITY.format_error_backtrace;
WAR_V:=errbuf;
fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace
);
WHENOTHERS
THEN
DBMS_OUTPUT.PUT_LINE(Nodatafound);
retcode:=1;
errbuf:=

ErrorinPayrollABSENCEIntegration
||SUBSTR(SQLERRM,1,1000)
||DBMS_UTILITY.format_error_backtrace;
fnd_file.put_line(
fnd_file.LOG,
NoDataFound||DBMS_UTILITY.format_error_backtrace
);
WAR_V:=errbuf;
END;
ENDMOISS_PAYROLL_INT_API;

Program Body for Testing or Sample data Test


CREATEORREPLACEPACKAGEBODYMOISS_PAYROLL_INT_API
AS
PROCEDUREMOISS_ABSENCE_PAYROLL(BUISNESS_G_VNUMBER,
START_DATE_VVARCHAR2,
END_DATE_VVARCHAR2,
WAR_VOUTVARCHAR2)
IS
CURSORc
IS
SELECTDISTINCTEMPLOYEE_ID,ATT_DATE
FROMmoiss_emp_attendance

WHEREday_type=WO
ANDATT_DATEBETWEENTO_DATE(START_DATE_V,MM/DD/YYYY)TO_DATE
(10/19/2013,MM/DD/YYYY)
ANDTO_DATE(END_DATE_V,MM/DD/YYYY)
TO_DATE(10/20/2013,MM/DD/YYYY)
ANDemployee_id=30;

SELECT*FROMmoiss_emp_attendance
x_START_DATE_Vdate=10/18/2013;
x_absence_daysnumber;
x_absence_hoursnumber:=10;
:=ABS_HOUR_V;Ifapplicablewehavetoinclude
X_absence_attendance_type_idnumber:=7;
:=ATT_TYPE_ID_V;Ifapplicablewehavetoinclude
x_absence_attendance_idnumber;
x_object_version_numbernumber;
x_occurrencenumber;
x_dur_dys_less_warningboolean;
x_dur_hrs_less_warningboolean;
x_exceeds_pto_entit_warningboolean;
x_exceeds_run_total_warningboolean;
x_abs_overlap_warningboolean;
x_abs_day_after_warningboolean;

x_dur_overwritten_warningboolean;
BEGIN

DBMS_OUTPUT.PUT_LINE(THEvaluesAREIS||BUISNESS_G_V||
START_DATE_V||END_DATE_V);
FORIINC
LOOP

hr_person_absence_api.create_person_absence(
p_validate=>FALSE,
p_effective_date=>I.ATT_DATE,
p_person_id=>I.EMPLOYEE_ID,
p_business_group_id=>BUISNESS_G_V,
101,
p_absence_attendance_type_id=>X_absence_attendance_type_id,
71,VACATIONLEAVE
p_date_projected_start=>I.ATT_DATE,
p_time_projected_start=>NULL,
Ifapplicablewehavetoinclude
p_date_projected_end=>I.ATT_DATE,
p_time_projected_end=>NULL,
Ifapplicablewehavetoinclude
p_date_start=>I.ATT_DATE,

p_time_start=>NULL,
Ifapplicablewehavetoinclude18:00,
p_date_end=>I.ATT_DATE,
p_time_end=>NULL,
Ifapplicablewehavetoinclude20:00,
p_date_start=>sysdate,
p_date_end=>sysdate+1,
p_absence_days=>x_absence_days,
p_absence_hours=>x_absence_hours,
p_absence_attendance_id=>x_absence_attendance_id,
p_object_version_number=>x_object_version_number,
p_occurrence=>x_occurrence,
p_dur_dys_less_warning=>x_dur_dys_less_warning,
p_dur_hrs_less_warning=>x_dur_hrs_less_warning,
p_exceeds_pto_entit_warning=>x_exceeds_pto_entit_warning,
p_exceeds_run_total_warning=>x_exceeds_run_total_warning,
p_abs_overlap_warning=>x_abs_overlap_warning,
p_abs_day_after_warning=>x_abs_day_after_warning,
p_dur_overwritten_warning=>x_dur_overwritten_warning
);
ENDLOOP;

COMMIT;

EXCEPTION
WHENOTHERS
THEN
WAR_V:=ERROROCCURED||sqlERRM;
ENDMOISS_ABSENCE_PAYROLL;

/*Formattedon1/16/20146:13:49PM(QP5v5.114.809.3010)*/
PROCEDUREMOISS_WORKDAY_OVERTIME_PAYROLL(BUISNESS_G_VNUMBER,
START_DATE_VVARCHAR2,
END_DATE_VVARCHAR2,
WAR_VOUTVARCHAR2)
IS
v_batch_idvarchar2(60);
x_batch_idnumber:=0;
x_ver_nonumber;
x_batch_line_idnumber;
g_ver_nonumber;
x_ver_no_1number;

CURSORc
IS

SELECTDISTINCT
WORKDAY_OVERTIME,PAF.ASSIGNMENT_ID,paf.assignment_number
FROMxxtest_emp_attendancemea,per_assignments_fpaf
WHEREpaf.person_id=mea.employee_id
ANDWORKDAY_OVERTIMEISNOTNULL;
BEGIN
SELECTTO_CHAR(SYSDATE)INTOv_batch_idFROMDUAL;
FORiINc
LOOP
pay_batch_element_entry_api.create_batch_header(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_name=>MOISS_OVERTIME||v_batch_id,
p_batch_status=>U,unprocessed
p_business_group_id=>202,
202,101business_group_id
p_action_if_exists=>I,
i=createnewentry,u=updateentry
p_batch_reference=>NULL,
g_user_name||||to_char(sysdate,ddmonyyyy)
p_batch_source=>NULL,nameofthebatch
p_comments=>NULL,
p_date_effective_changes=>NULL,

p_purge_after_transfer=>N,
p_reject_if_future_changes=>Y,
p_batch_id=>x_batch_id,
p_object_version_number=>g_ver_no,
p_reject_if_results_exists=>Y,
p_purge_after_rollback=>N,
p_batch_type=>NULL,
p_reject_entry_not_removed=>N,
p_rollback_entry_updates=>N
);
DBMS_OUTPUT.put_line(
v_batch_id||v_batch_id||x_batch_id||g_ver_no
);
pay_batch_element_entry_api.create_batch_line(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_id=>x_batch_id,
p_assignment_id=>i.ASSIGNMENT_ID,
p_assignment_number=>i.assignment_number,
p_batch_sequence=>NULL,
p_effective_date=>SYSDATE,l_effective_date
p_element_type_id=>50944,OvertimeOTMSpecialInputs
p_entry_type=>E,

p_value_1=>i.WORKDAY_OVERTIME,
holidayovertimehrs
p_value_2=>15,AssumingValue
regularovertimehrs,
p_batch_line_id=>x_batch_line_id,
p_object_version_number=>x_ver_no_1
);
ENDLOOP;
COMMIT;
EXCEPTION
WHENOTHERS
THEN
WAR_V:=ERROROCCURED||sqlERRM;
dbms_output.put_line(dbms_utility.format_error_backtrace);
END;

PROCEDUREMOISS_HOLIDAY_OVERTIME_PAYROLL(BUISNESS_G_VNUMBER,
START_DATE_VVARCHAR2,
END_DATE_VVARCHAR2,
WAR_VOUTVARCHAR2)
IS
v_batch_idVARCHAR2(60);

x_batch_idnumber;
x_ver_nonumber;
x_batch_line_idnumber;
g_ver_nonumber;
x_ver_no_1number;
CURSORc
IS
SELECTDISTINCT
HOLIDAY_OVERTIME,PAF.ASSIGNMENT_ID,paf.assignment_number
FROMxxtest_emp_attendancemea,per_assignments_fpaf
WHEREpaf.person_id=mea.employee_id
ANDMEA.HOLIDAY_OVERTIMEISNOTNULL;

BEGIN
SELECTTO_CHAR(SYSDATE)INTOv_batch_idFROMDUAL;
FORiINc
LOOP
pay_batch_element_entry_api.create_batch_header(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_name=>M_HOLI_OVERTIME||v_batch_id,
p_batch_status=>U,unprocessed
p_business_group_id=>202,fnd_global.per_business_group_id,

202,101business_group_id
p_action_if_exists=>I,
i=createnewentry,u=updateentry
p_batch_reference=>NULL,
g_user_name||||to_char(sysdate,ddmonyyyy)
p_batch_source=>NULL,nameofthebatch
p_comments=>NULL,
p_date_effective_changes=>NULL,
p_purge_after_transfer=>N,
p_reject_if_future_changes=>Y,
p_batch_id=>x_batch_id,
p_object_version_number=>g_ver_no,
p_reject_if_results_exists=>Y,
p_purge_after_rollback=>N,
p_batch_type=>NULL,
p_reject_entry_not_removed=>N,
p_rollback_entry_updates=>N
);
DBMS_OUTPUT.put_line(
v_batch_id||v_batch_id||x_batch_id||g_ver_no
);
pay_batch_element_entry_api.create_batch_line(
p_validate=>FALSE,

p_session_date=>SYSDATE,
p_batch_id=>x_batch_id,
p_assignment_id=>i.ASSIGNMENT_ID,
p_assignment_number=>i.assignment_number,
p_batch_sequence=>NULL,
p_effective_date=>SYSDATE,l_effective_date
p_element_type_id=>50749,EarningspaidforHolidaystraight
time)
p_entry_type=>E,
p_value_1=>i.HOLIDAY_OVERTIME,
holidayovertimehrs
p_value_2=>15,AssumingValue(Valuestobenoted)
regularovertimehrs,
p_batch_line_id=>x_batch_line_id,
p_object_version_number=>x_ver_no_1
);
ENDLOOP;
COMMIT;

EXCEPTION
WHENOTHERS
THEN
dbms_output.put_line(dbms_utility.format_error_backtrace);

WAR_V:=ERROROCCURED||sqlERRM;
END;

PROCEDUREMOISS_WORKSHOP_BONUS_PAYROLL(BUISNESS_G_VNUMBER,
START_DATE_VVARCHAR2,
END_DATE_VVARCHAR2,
WAR_VOUTVARCHAR2)
IS
v_batch_idVARCHAR2(60);
x_batch_idnumber;
x_ver_nonumber;
x_batch_line_idnumber;
g_ver_nonumber;
x_ver_no_1number;

CURSORc
IS

SELECTDISTINCT
WORKSHOP_BONUS,PAF.ASSIGNMENT_ID,paf.assignment_number
FROMxxtest_emp_attendancemea,per_assignments_fpaf
WHEREpaf.person_id=mea.employee_id

ANDMEA.WORKSHOP_BONUSISNOTNULL;

BEGIN

SELECTTO_CHAR(SYSDATE)INTOv_batch_idFROMDUAL;

FORiINc
LOOP
pay_batch_element_entry_api.create_batch_header(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_name=>WORKSHOP_BONUS||v_batch_id,
p_batch_status=>U,unprocessed
p_business_group_id=>202,fnd_global.per_business_group_id,
202,101business_group_id
p_action_if_exists=>I,
i=createnewentry,u=updateentry
p_batch_reference=>NULL,
g_user_name||||to_char(sysdate,ddmonyyyy)
p_batch_source=>NULL,nameofthebatch
p_comments=>NULL,
p_date_effective_changes=>NULL,
p_purge_after_transfer=>N,

p_reject_if_future_changes=>Y,
p_batch_id=>x_batch_id,
p_object_version_number=>g_ver_no,
p_reject_if_results_exists=>Y,
p_purge_after_rollback=>N,
p_batch_type=>NULL,
p_reject_entry_not_removed=>N,
p_rollback_entry_updates=>N
);
DBMS_OUTPUT.put_line(
v_batch_id||v_batch_id||x_batch_id||g_ver_no
);
pay_batch_element_entry_api.create_batch_line(
p_validate=>FALSE,
p_session_date=>SYSDATE,
p_batch_id=>x_batch_id,
p_assignment_id=>i.ASSIGNMENT_ID,
p_assignment_number=>i.assignment_number,
p_batch_sequence=>NULL,
p_effective_date=>SYSDATE,l_effective_date
p_element_type_id=>51661,ProductionBonus
p_entry_type=>E,
p_value_1=>i.WORKSHOP_BONUS,

holidayovertimehrs
p_value_2=>15,AssumingValue(Valuestobenoted)
regularovertimehrs,
p_batch_line_id=>x_batch_line_id,
p_object_version_number=>x_ver_no_1
);
DBMS_OUTPUT.put_line(
v_batch_id||x_batch_line_id||x_ver_no_1);
ENDLOOP;

COMMIT;

EXCEPTION
WHENOTHERS
THEN
dbms_output.put_line(dbms_utility.format_error_backtrace);
WAR_V:=ERROROCCURED||sqlERRM;
END;
ENDMOISS_PAYROLL_INT_API;

Program

DECLARE

Execution

VAR_VVARCHAR2(500);
begin
MOISS_PAYROLL_INT_API.MOISS_ABSENCE_PAYROLL(202,TO_DATE
(01/02/2014,mm/dd/yyyy),TO_DATE(01/02/2014,
mm/dd/yyyy),VAR_V)
MOISS_PAYROLL_INT_API.MOISS_WORKDAY_OVERTIME_PAYROLL(202,
TO_DATE(01/02/2012,mm/dd/yyyy),TO_DATE(01/02/2012,
mm/dd/yyyy),VAR_V);
MOISS_PAYROLL_INT_API.MOISS_BONUS_OVERTIME_ALL_E(01MAR
2012,31MAR2012);
MOISS_PAYROLL_INT_API.MOISS_ABSENCE_PAYROLL(29,01MAR2012,31
MAR2012);
MOISS_PAYROLL_INT_API.MOISS_WORKSHOP_BONUS_PAYROLL(202,TO_DATE
(01/02/2012,mm/dd/yyyy),TO_DATE(01/02/2012,
mm/dd/yyyy),VAR_V);
dbms_output.put_line(WehavethisError||var_v);
end;

Note:
To run as PLSQL procedure it there is no need for ErrBuf and retcode elements. But they are
mandatory while using in the oracle apps.

Now we have to deploy this procedure. Just get the last post which is deployment.
HRMS to GL Mapping Issue

I got a weird Issue from finance department that they were unable to get the payroll information.
When I checked the costing report in HRMS everything seemed fine. Then on seeing the
backend information I was able to see that LedgerID and Chart of Accounts ID was missing from
the GL_INTERFACE table.
I checked the GL Mapping there the mapping was not there.

Navigation
Global HRMS Manager > Payroll > GL Flexfield Map.
Now after the mapping is done Issue is resolved.
Getting Code Combination ID using fnd_flex_ext.get_ccid

Sometimes for Retrival of the Code Combinations the view(gl_code_combinations_kfv) will not
be enough. We need a function to get the value so at that time we can use fnd_flex_ext.get_ccid
to get the Code Combination.
select fnd_flex_ext.get_ccid(
SQLGL, Application Short Name
GL#, key_flex_code
50357, structure_number => this value we can obtain from this Query select
chart_of_accounts_id from gl_sets_of_books where set_of_books_id = 2021;
sysdate, Validation Date
01-00-11113-001-00-00 Concatenated Segments
) from dual;

You might also like