Skip to Content
Technical Articles

Salary Register Report with Posting Run Id and FI document number for Reconciliation

Introduction

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.

Functionality Description:

  1. Requirement to get the Salary register report after completion of payroll for the particular period.
  2. Report should generate based on Payroll Area and business area. Payroll Area and business area Business area is the primary key for this report.
  3. The report contains employee salary details for a month including statutory, Posting RUN ID and FICO document no.

Input Requirements:

  1. Create a custom report for Salary register with the below input selection screen shot.
  2. 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.
  3. Make Payroll area as a mandatory field. Without Payroll area report should not execute.

Processing Requirements.

  1. Read the Function module “CU_READ_RGDIR” to get the Cluster results using RGDIR.
  2. Get the sequence number for the particular period with the Status indicator ‘A’.
  3. 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
    ​
  4. Read the data when In-period is equal For-period.
  5. Find below details which contains the layout with the field name details.

 

  1. Create a Transaction code called ZHR_SALRECONSILE.
  2. 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.
  3. Get the HCM number from the table PPDHD-DOCNUM by passing the PPDHD-RUNID and PPDHD-BUDAT.
  4. The document number should match with Business area of the selection screen in the table PPDIT-GSBER.
  5. Read the table BKPF to fetch FI document number for the particular HCM no.
  6. 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.

Out Put.

Conclusion:

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….

 

Be the first to leave a comment
You must be Logged on to comment or reply to a post.