Application Development 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: 

ABAP-HR Payroll

Former Member
0 Kudos
940

Hi Friends,

What are the function modules require to create country specific payrol report???

Regards

Naveen

5 REPLIES 5

MarcinPciak
Active Contributor
0 Kudos
266

Hi,

Payroll results can be extracted using the following methods:

–If there is a need to do processing at individual steps:

1) Read cluster directory using ‘CU_READ_RGDIR’

2) Read valid period from cluster directory using ‘CU_READ_LAST’

3) Read payroll results using ‘PYXX_READ_PAYROLL_RESULT’using SEQNO returned by ‘CU_READ_LAST’.

–Otherwise:

1)Using function module ‘PYXX_GET_EVALUATION_PERIODS’or

2)Using function module ‘HR_GET_PAYROLL_RESULTS’to import current payroll results.

Lets discuss first solution for country PL (where I am from;) )

First you need to define country specific data object:

DATA:it_pay_result TYPE pay<b>pl</b>_result.

pay<b>pl</b>_result is the country specific payroll result type for Poland:

For different country use its abbreveation i.e. for NL - paynl_result etc.

Then define such structure:

DATA: BEGIN OF it_rgdir OCCURS 0.

INCLUDE STRUCTURE pc261.

DATA: END OF it_rgdir.

This one is to retrieve payroll clusters.

Now let's read the cluster for an employee.

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

persnr = here you put personnel number

IMPORTING

molga = molga

TABLES

in_rgdir = it_rgdir

EXCEPTIONS

no_record_found = 1

OTHERS = 2.

Now when we have <b>all</b>clusters taken for particular employee lets read all tables for one each payroll period.

Note! For each payroll period i.e. 07.2007 we have lots of tables to process, they keep differnet data. In it_rgdir we have clusters for all payroll periods which were run for this employee. Lest iterate thru them (alternatively we could just use FM 'CU_READ_LAST' to read the latest payroll run)

LOOP AT it_rgdir WHERE paydt BETWEEN start_date AND end_date.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

clusterid = 'PL' "here put either NL, BE - your country abrev.

employeenumber = pernr

sequencenumber = it_rgdir-seqnr

CHANGING

payroll_result = it_pay_result

EXCEPTIONS

illegal_isocode_or_clusterid = 1

error_generating_import = 2

import_mismatch_error = 3

subpool_dir_full = 4

no_read_authority = 5

no_record_found = 6

versions_do_not_match = 7

OTHERS = 8.

endloop.

Now you have deep structure which contains payroll result for polish employee for all payroll periods. Using 'CU_READ_LAST' you would have only last one.

If you have more doubts see this document:

http://www.melayu.plus.com/SAP%20HR%20Programming.pdf

Please reward if helpfull.

Cheers:)

0 Kudos
266

hii

  can you expalin me about log detais in hr-abap.

Former Member
0 Kudos
266

Hi Friends,

Can anybody send some payroll objects to my mail: kusuma_naveen@yahoo.co.in

best answers points : 6.

Regards

Naveen

Message was edited by:

Naveen Kumar

Former Member
0 Kudos
266

can anybody send objects on payroll

Regards

Naveen

Former Member
0 Kudos
266

can u please help me to calculate the income tax paid by particular employee for the selected fiscal year .. ??