Skip to Content
0
Former Member
Jun 06, 2005 at 09:27 AM

Accessing Payroll Data

34 Views

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.