cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Payroll Data

Former Member
0 Kudos

SAP have developed a new class for access payroll results as detailed in not 699276 and give an example of how to use it that is very similar to the code below. The example works just as documented and returns the results in the variable <b>go_pernr_pr</b>. In debugger I can drill down and see all the results sitting there but I can't identify how reference the results in my program e.g. How do I refrence the RT table?

report zrubbish6.

data go_prr type ref to CL_HRPAY99_PRR_4_PNP_REPS.

data gt_pernr_pr type H99_HR_PAY_RESULT_TAB.

data <b>go_pernr_pr</b> type ref to CL_HR_PAY_RESULT_GB.

tables pernr.

field-symbols <pernr_pr> type ref to CL_HR_PAY_RESULT.

START-OF-SELECTION.

CALL METHOD cl_hrpay99_prr_4_pnp_reps=>get_instance

EXPORTING

IM_PN_BEGDA = pn-begda

IM_PN_ENDDA = pn-endda

IM_MOLGA = '08'

IM_ADD_RETROES_TO_RGDIR = 'X'

IMPORTING

EX_PRR = go_prr

EXCEPTIONS

INVALID_ENTRIES = 1

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

GET PERNR.

call method go_prr->GET_PERNR_PAYR_RESULTS_ALLIN1

exporting im_pernr = pernr-pernr

importing EX_PERNR_PAYROLL_RESULTS = gt_pernr_pr.

loop at gt_pernr_pr assigning <pernr_pr>.

<b>go_pernr_pr</b> ?= <pernr_pr>.

  • Here do what you have to do with each result

endloop.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Solved

report zrubbish6.

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.

tables: pernr.

field-symbols <pernr_pr> type ref to CL_HR_PAY_RESULT.

field-symbols <wa_rt> type PC207.

START-OF-SELECTION.

CALL METHOD cl_hrpay99_prr_4_pnp_reps=>get_instance

EXPORTING

IM_PN_BEGDA = pn-begda

IM_PN_ENDDA = pn-endda

IM_MOLGA = '08'

IM_ADD_RETROES_TO_RGDIR = 'X'

IMPORTING

EX_PRR = go_prr

EXCEPTIONS

INVALID_ENTRIES = 1

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

GET PERNR.

call method go_prr->GET_PERNR_PAYR_RESULTS_ALLIN1

exporting im_pernr = pernr-pernr

importing EX_PERNR_PAYROLL_RESULTS = gt_pernr_pr.

loop at gt_pernr_pr assigning <pernr_pr>.

go_pernr_pr ?= <pernr_pr>.

loop at go_pernr_pr->INTER-RT assigning <wa_rt>.

write : / go_pernr_pr->PERIOD-FPPER, go_pernr_pr->PERIOD-INPER, go_pernr_pr->PERIOD-SRTZA, <wa_rt>-lgart, <wa_rt>-betrg..

endloop.

endloop.

Former Member
0 Kudos

Richard,

What version are you on? I'm on 4.7 and could not find the class cl_hrpay99_prr_4_pnp_reps.

Thanks.