on 06-06-2005 10:27 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.