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: 

How to Read Payroll

Former Member
0 Kudos
143

HI guys

can any one give me step by step proce for interview question

How to read Payroll Result

thanks you

Abdullah Ahmed

1 ACCEPTED SOLUTION

Former Member
0 Kudos
80

HI

If you need to do a form to report wages and the data is stored in the PCL4 Cluster.

You can look at this example report or form that retrieves data from this cluster based on several parameters that are entered when the report is executed online (like employee number and tax year).

In SE38 or SA38, execute the sample program EXAMPLE_PNP_GET_PAYROLL

Reward all helpfull answers

Regards

Pavan

7 REPLIES 7

Former Member
0 Kudos
80

Hi Abdullah,

Look at this thread.

this answers almost everything u need.

Amandeep

jayanthi_jayaraman
Active Contributor
0 Kudos
80

Hi,

You need to use 'CU_READ_RGDIR' Function module to get rgdir vales.After that, delete the unnecessary values in that and pass it to fucntion module 'PYXX_READ_PAYROLL_RESULT' to get payroll results

data : li_payres type payau_result,"Payroll Result

i_rt type standard table of pc207,"Payroll Result.

loop at i_pernr into w_pernr.

clear li_payres.

refresh i_rt[].

  • Getting Payroll Cluster

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

PERSNR = w_pernr-pernr

TABLES

IN_RGDIR = i_rgdir

EXCEPTIONS

NO_RECORD_FOUND = 1

OTHERS = 2.

IF SY-SUBRC eq 0.

if p_proj eq c_x.

delete i_rgdir where srtza NE 'A'.

endif.

ENDIF.

endloop.

loop at i_rgdir into w_rgdir.

clear li_payres.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

CLUSTERID = 'RQ' "Differs according to country

EMPLOYEENUMBER = lv_pernr

SEQUENCENUMBER = w_rgdir-seqnr

CHANGING

PAYROLL_RESULT = li_payres

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

ERROR_READING_ARCHIVE = 8

ERROR_READING_RELID = 9

OTHERS = 10.

IF SY-SUBRC eq 0.

append lines of li_payres-inter-rt to i_rt.

endif.

clear w_rgdir.

endloop.

.

Sougata
Active Contributor
0 Kudos
80

you can use GET PAYROLL to retrieve this using the standard Logical Database PNP.

Former Member
0 Kudos
80

Salam Abdul ,

You Can

1) 'CU_READ_RGDIR' FM

2) 'PYXX_READ_PAYROLL_RESULT' to get payroll results

Former Member
0 Kudos
80

Hi abdullah,

1. U want the remuneration (monthly salary )

2. U won't get it DIRECTLY from any table.

(Its stored in cluster format)

3. Use this logic and FM.

DATA: myseqnr LIKE hrpy_rgdir-seqnr.

DATA : mypy TYPE payin_result.

DATA : myrt LIKE TABLE OF pc207 WITH HEADER LINE.

SELECT SINGLE seqnr FROM hrpy_rgdir

INTO myseqnr

WHERE pernr = mypernr

AND fpper = '200409'

AND srtza = 'A'.

IF sy-subrc = 0.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

clusterid = 'IN'

employeenumber = mypernr

sequencenumber = myseqnr

CHANGING

payroll_result = mypy

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

error_reading_archive = 8

error_reading_relid = 9

OTHERS = 10.

myrt[] = mypy-inter-rt.

READ TABLE myrt WITH KEY lgart = '1899'.

4. the internal table myrt

will contain what u require.

regards,

amit m.

Former Member
0 Kudos
81

HI

If you need to do a form to report wages and the data is stored in the PCL4 Cluster.

You can look at this example report or form that retrieves data from this cluster based on several parameters that are entered when the report is executed online (like employee number and tax year).

In SE38 or SA38, execute the sample program EXAMPLE_PNP_GET_PAYROLL

Reward all helpfull answers

Regards

Pavan