Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Payroll result using class CL_HRPAY99_PRR_4_PNP_REPS

Hi All,

My questions are:

1. How to read last payroll result using this class (like when we use FM approach, we can use FM 'CD_READ_LASR' and then use the SEQNR in FM 'PYXX_READ_PAY_RESULT').

2. When I use the below code, it still returns me all the payroll results in gt_pernr_pr. I was expecting only april results. Where I am going wrong?

data go_prr       type ref to CL_HRPAY99_PRR_4_PNP_REPS.
data gt_pernr_pr  type H99_HR_PAY_RESULT_TAB.
data go_pernr_pr  type ref to CL_HR_PAY_RESULT_GB.
DATA ls_RT TYPE PC207.
field-symbols <pernr_pr> type ref to CL_HR_PAY_RESULT.
START-OF-SELECTION.
  call method CL_HRPAY99_PRR_4_PNP_TISPAN=>GET_INSTANCE
    exporting IM_PN_BEGDA = '20070401'
              IM_PN_ENDDA = '20070430'
              IM_MOLGA = '08'
    importing ex_prr = go_prr
    exceptions INVALID_ENTRIES = 4.

GET PERAS.

  call method go_prr->GET_PERNR_PAYR_RESULTS_ALLIN1
    exporting im_pernr = pernr-pernr
    importing EX_PERNR_PAYROLL_RESULTS = gt_pernr_pr
    exceptions COUNTRY_VERSION_NOT_AVAILABLE = 1
                NO_AUTHORIZATION = 2
                READ_ERROR = 4.
  IF SY-SUBRC = 0.
  loop at gt_pernr_pr assigning <pernr_pr>.
    go_pernr_pr ?= <pernr_pr>.
    LOOP AT go_pernr_pr->INTER-RT INTO ls_RT.
      WRITE: / ls_RT-LGART, ls_RT-BETRG.
    ENDLOOP.
  endloop.
  ENDIF.

Thanks,

Bhaskar

Not what you were looking for? View more on this topic or Ask a question