Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

payroll code

Former Member
0 Likes
591

Hi

Can you send me simple payroll code using

GET PAYROLL event.

i know the function module method.

thanks&regards,

Quavi

1 REPLY 1
Read only

Former Member
0 Likes
434

Hi,

you can also use classes to read payroll without using GET Payroll event !!!

check out ( OSS note # 699276 )

The logical database GET PAYROLL has now been replaced with the class CL_HRPAY99_PRR_4_REPORTING. "PRR" is "Payroll Result Reader". It is succeeded by CL_HRPAY99_PRR_4_PNP_REPS and CL_HRPAY99_PRR_4_PNPCE_REPS, for use in programs with the logical database PNP or PNPCE (multiple payroll).

These two classes are further succeeded by three classes that allow free period selection, individual day selection, or settlement run selection. Only these may be instantiated to read payroll results. They are:

CL_HRPAY99_PRR_4_PNP_TISPAN

CL_HRPAY99_PRR_4_PNP_SNGDAY

CL_HRPAY99_PRR_4_PNP_PAYPER

CL_HRPAY99_PRR_4_PNPCE_TISPAN

CL_HRPAY99_PRR_4_PNPCE_SNGDAY

CL_HRPAY99_PRR_4_PNPCE_PAYPER

To simplify the class instantiation, the method GET_INSTANCE is available as an alternative. If you have multiple payroll, use CL_HRPAY99_PRR_4_PNPCE_REPS->GET_INSTANCE; otherwise use CL_HRPAY99_PRR_4_PNP_REPS->GET_INSTANCE; a suitable point for this call is the event START-OF-SELECTION.

These new classes allow simple access to the payroll results, are CE-compatible, are expandable (class succession) and can take into account a variety of selection criteria.

The structure H99_PAYROLL_RESULT_READER contains all selection criteria that you may need in your programs, with altered texts and documentation. You can use these in the selection screens in your reports, for example.

Prerequisites

Child classes of the classes CL_HR_PAY_RESULT and, if you have multiple payroll, also CL_HR_PAY_RESULT_PERSON, must be available for your country version. These daughter classes are called CL_HR_PAY_RESULT_** where ** is the ISO code indicator for your country. The German version is called CL_HR_PAY_RESULT_DE, for example; the American version is called CL_HR_PAY_RESULT_US and the American version for multiple payroll is called CL_HR_PAY_RESULT_PERSON_US.

Examples of use

If you have multiple payroll:

data go_prr type ref to CL_HRPAY99_PRR_4_PNPCE_REPS.

data gt_person_pr type H99_HR_PAY_RESULT_PERSON_TAB.

data gt_peras_pr type H99_HR_PAY_RESULT_TAB.

field-symbols <person_pr> type ref to CL_HR_PAY_RESULT_PERSON.

field-symbols <peras_pr> type ref to CL_HR_PAY_RESULT.

data go_person_pr type ref to CL_HR_PAY_RESULT_PERSON_**.

data go_peras_pr type ref to CL_HR_PAY_RESULT_**.

START-OF-SELECTION.

call method CL_HRPAY99_PRR_4_PNPCE_REPS=>GET_INSTANCE

exporting (...)

importing ex_prr = go_prr

exceptions INVALID_ENTRIES = 4.

GET PERSON.

call method go_prr->GET_P_P_PAYR_RESULTS_ALLIN1

exporting im_person = person

importing EX_PERSON_PAYROLL_RESULTS = gt_person_pr

EX_PERAS_PAYROLL_RESULTS = gt_peras_pr

exceptions (...).

  • The person results are now in table gt_person_pr

  • and the contract results in table gt_peras_pr

loop at gt_person_pr assigning <person_pr>.

go_person_pr ?= <person_pr>.

  • Here do what you have to do with each result

endloop.

loop at gt_peras_pr assigning <peras_pr>.

go_peras_pr ?= <peras_pr>.

  • Here do what you have to do with each result

endloop.

If you do not have multiple payroll:

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_**.

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 (...)

importing ex_prr = go_prr

exceptions INVALID_ENTRIES = 4.

GET PERNR.

call method go_prr->GET_PERNR_PAYR_RESULTS_ALLIN1

exporting im_pernr = pernr-pernr

importing EX_PERNR_PAYROLL_RESULTS = gt_pernr_pr

exceptions (...).

  • The results are now in table gt_pernr_pr

loop at gt_pernr_pr assigning <pernr_pr>.

go_pernr_pr ?= <pernr_pr>.

  • Here do what you have to do with each result

endloop.

<b>Reward points</b>

Regards