Wednesday, May 10, 2023

OOPS ABAP HR: Pay Result (US)

Get Data from Payroll (US Payroll)

Step 1: Data declaration 

data: ls_rgdir type pc261

(lo_payresult_access) = NEW cl_hr_pay_access( ),

lo_emp_pay_result type ref to cl_hr_pay_result,

lo_emp_pay_result_us type ref to cl_hr_pay_result_us.


Step 2. Get data from table HRPY_RGDIR

Get the records from table HRPY_RGDIR and store the data in an internal table lt_rgdir[]

with needful where clause(s).


Step 3: Use class CL_HR_PAY_ACCESS and CL_HR_PAY_RESULT

LOOP the internal table lt_regdir[] to assigned fields symbol <fs_rgdir>

ls_rgdir = <fs_rgdir>.

call method lo_payresult_access->read_pay_result (by paasing ls_rgdir)

Get the result in object lo_emp_pay_result.

Use the object lo_emp_pay_result for RT/TCRT/CRT table to read or loop.


RT Result will be found (for all countries):

lo_emp_pay_result->inter-rt[].

Wide cast to US data (as needed only for MOLGA US

lo_emp_pay_result_us ?= lo_emp_pay_result.


US Garnishment result will be found in:

lo_emp_pay_result_us->natio-grdoc[] and lo_emp_pay_result->natio-grrec[]

ENDLOOP.

0 comments: