Salary Register Report with Posting Run Id and FI document number for Reconciliation
The business requirement is to use Account department to reconcile posted salary data between HCM and FICO module, worked around the same and started writing this blog.
- Requirement to get the Salary register report after completion of payroll for the particular period.
- Report should generate based on Payroll Area and business area. Payroll Area and business area Business area is the primary key for this report.
- The report contains employee salary details for a month including statutory, Posting RUN ID and FICO document no.
- Create a custom report for Salary register with the below input selection screen shot.
- After the executing the payroll for the particular period, the results will get store in the RT. Read the below Function modules to get the RT results.
- Make Payroll area as a mandatory field. Without Payroll area report should not execute.
- Read the Function module “CU_READ_RGDIR” to get the Cluster results using RGDIR.
- Get the sequence number for the particular period with the Status indicator ‘A’.
- Read the Function module “PYXX_READ_PAYROLL_RESULT” to get sequence number and pass it to the table payroll.
FORM get_payresult . DATA: lv_fpper TYPE faper. CLEAR : it_rgdir, payroll. CALL FUNCTION 'CU_READ_RGDIR' EXPORTING persnr = pernr-pernr * BUFFER = * NO_AUTHORITY_CHECK = ' ' IMPORTING molga = molga TABLES in_rgdir = it_rgdir EXCEPTIONS no_record_found = 1 OTHERS = 2. * IF sy-subrc <> 0. * ** write:/ 'result does not exist for pernr' . ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO ** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. * ENDIF. CONCATENATE pnpdispj pnpdispp INTO lv_fpper. **--insertion of code for rejecting inactive pernr READ TABLE it_rgdir WITH KEY fpper = lv_fpper TRANSPORTING NO FIELDS. IF sy-subrc <> 0. REJECT. ENDIF. **--end of code for rejecting inactive pernr. LOOP AT it_rgdir INTO wa_rgdir WHERE "SRTZA EQ 'A' AND " GETTING THE ACTIVE RESULT FOR THE SPECIFIED DATE fpper EQ lv_fpper AND "FPBEG GE PN-BEGDA AND " inper EQ lv_fpper AND "FPEND LE PN-ENDDA AND " abkrs EQ p0001-abkrs AND void IS INITIAL AND reversal IS INITIAL . MOVE wa_rgdir-seqnr TO seqnr . CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT' EXPORTING clusterid = 'IN' employeenumber = pernr-pernr sequencenumber = seqnr * READ_ONLY_BUFFER = ' ' * READ_ONLY_INTERNATIONAL = ' ' * ARC_GROUP = ' ' * CHECK_READ_AUTHORITY = 'X' * FILTER_CUMULATIONS = 'X' * CLIENT = * IMPORTING * VERSION_NUMBER_PAYVN = * VERSION_NUMBER_PCL2 = CHANGING payroll_result = payroll "payresult EXCEPTIONS illegal_isocode_or_clusterid = 1 error_generating_import = 2 import_mismatch_error = 3 subpool_dir_full = 4 no_read_authority = 5 no_record_found = 6 versions_do_not_match = 7 error_reading_archive = 8 error_reading_relid = 9 OTHERS = 10. IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. ENDLOOP . ENDFORM. " GET_PAYRESULT
- Read the data when In-period is equal For-period.
- Find below details which contains the layout with the field name details.
- Create a Transaction code called ZHR_SALRECONSILE.
- Provide Posting date as an input field in the selection screen of the report. Check the posting date with the posting status = ‘50’ and get the document run and document number from the table PPDHD.
- Get the HCM number from the table PPDHD-DOCNUM by passing the PPDHD-RUNID and PPDHD-BUDAT.
- The document number should match with Business area of the selection screen in the table PPDIT-GSBER.
- Read the table BKPF to fetch FI document number for the particular HCM no.
- Read the field posting date and T code BKPF-BELNR (Selection screen posting date) and BKPF-TCODE (make PCP0 always const). By passing these fields get the FI Accounting document number BKPF-BELNR.
This ALV report developed for FI department to reconcile the posted salary data to GL and wage type wise, its helps to auditor for checking posted entry for both the module in single report.
Further, for any clarifications please comment so, that same can be explained in detail….