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 result

Former Member
0 Likes
1,623

Hi Experts !

plz tell me how i can read payroll clusters and result .

thanks

Hi Experts !

plz tell me how i can read payroll clusters and result .

thanks

4 REPLIES 4
Read only

Former Member
0 Likes
1,243

hi Ranjana,

include rpc2cd09. "Cluster CD Data-Definition

include rpc2ca00. "Cluster CA Data-Definition

include RPC2RKK0. "Cluster RK Data-Definition

include rpc2rx09. "Cluster internat. part

include rpppxd00. "Data befinition buffer PCL1/PCL2

include rpppxd10. "Common part buffer PCL1/PCL2

include rpppxm00. "Buffer handling routine

data : it_rgdir like pc261 occurs 0 with header line.

data : it_rt like PC207 occurs 0 with header line.

First get the payroll results using the FM : CU_READ_RGDIR

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

persnr = p_pernr <-- pass pernr here ...

TABLES

in_rgdir = it_rgdir.

IF sy-subrc = 0.

SORT it_rgdir BY seqnr.

ENDIF.

LOOP AT it_rgdir WHERE srtza = 'A'

AND void IS INITIAL

AND reversal IS INITIAL

AND fpper = v_fpper. <-- Pass the period for

which U want to get the payroll results

v_seqnr = it_rgdir-seqnr.

ENDLOOP.

rx-key-pernr = p_pernr.

rx-key-seqno = v_seqnr.

rp-imp-c2-rk. <-- relid for canada is 'RK'

it_rt] = rt[. ---> results table ...

Now loop at rt .. and get the amounts for wage types ...

just an example ...

loop at it_rt.

if it_rt-lgart = '/101'.

v_betrg = it_rt-betrg.

endif.

endloop.

hope its clear to you,

Reward points if usefull,

Thanks,

Kalyan.

Read only

Former Member
0 Likes
1,243

hi

check this link

http://fuller.mit.edu/hr/cluster_tables.html

thanks

sitaram

Read only

HemendraS
Participant
0 Likes
1,243

Payroll Result Data Stored in PCL2.

u2022Stored in the transparent table PCL2.

u2022Example of some clusters available in PCL2:

u2013CU -Cluster directory

u2013RG -Payroll results (GB)

u2013B2 -Time management results

u2013ZL-Personal shift plan

u2013PS-Generated schema

u2013PT-Texts for generated schema

u2022Data is stored in CLUSTD field.

u2013To optimise data selection, RGDIR table of cluster CU is replicated into HRPY_RGDIR.

u2022Using LDB for HR-PY programming:

u2013PYORGSCREEN and PYTIMESCREEN need to be declared in TABLES statement for the extra payroll related selection-screen.

u2013PAYROLL node to be declared in the NODE statement with reference type to PAYGB_RESULT for UK or PAY99_RESULT for international.

u2013HR report category can be changed to use Payroll Results (Cluster) for selection screen customisation.

u2022GET PAYROLL.u2013PAYROLL structure will be populated. If more than one payroll period is specified at the selection screen, this event will be executed for each period.

u2013Payroll results internal table may contains more than one resultdepending on the u2018status of resultu2019selection.

u2013To evaluate payroll result, LOOP through the

PAYROLL-INTER-RT internal table.

-


First Using Get peras event read the RGDIR results as below

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

persnr = p_pernr

IMPORTING

molga = p_molga

TABLES

in_rgdir = p_rgdir

EXCEPTIONS

no_record_found = 1

OTHERS = 2.

Get the Cluster ID based on the molga value of the employee using T5001 table

Then Based on the RGDIR results loop retrive the payroll results below

LOOP AT gt_rgdir INTO wa_rgdir WHERE fpbeg LE wa_dates-endda AND fpend GE wa_dates-endda

AND srtza EQ c_a

AND payty EQ c_space.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

clusterid = wa_t500l-relid

employeenumber = pernr-pernr

sequencenumber = wa_rgdir-seqnr

read_only_international = 'X'

CHANGING

payroll_result = gt_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

error_reading_archive = 8

error_reading_relid = 9

OTHERS = 10.

EX:

TABLES: RP50G,PERNR,PYORGSCREEN,PYTIMESCREEN.

DATA: IN_RGDIR LIKE PC261 OCCURS 0 WITH HEADER LINE,

WA_RT LIKE PC207 OCCURS 0 WITH HEADER LINE,

SEQNR LIKE PC261-SEQNR,

RESULT TYPE PAY99_RESULT.

DATA: M_START LIKE SY-DATUM,

M_END LIKE SY-DATUM.

FORM GET_PAYROLL USING P_PERNR M_START M_END.

*This FM help us to get the Sequence number used for the

*employee on the payroll.

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

PERSNR = P_PERNR

TABLES

IN_RGDIR = IN_RGDIR

EXCEPTIONS

NO_RECORD_FOUND = 1

OTHERS = 2.

*We read it using two dates, which corresponds to the month *we need

READ TABLE IN_RGDIR WITH KEY FPBEG = M_START

FPEND = M_END.

SEQNR = IN_RGDIR-SEQNR.

*This FM actually reads the payroll and get the information

*we need.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

CLUSTERID = 'XX'

*In CLUSTERID use the country of your choice

EMPLOYEENUMBER = P_PERNR

SEQUENCENUMBER = SEQNR

READ_ONLY_INTERNATIONAL = 'X'

CHANGING

PAYROLL_RESULT = 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.

*We just need to read the result table.

LOOP AT RESULT-INTER-RT INTO WA_RT.

CASE WA_RT-LGART.

WHEN '9010'.

MOVE WA_RT-BETRG TO T_ANYTABLE-SOMEPAY.

ENDCASE.

ENDLOOP.

ENDFORM.

If helpful needs to appreciated.

Regards

Read only

HemendraS
Participant
0 Likes
1,243

Payroll Result Data Stored in PCL2.

u2022Stored in the transparent table PCL2.

u2022Example of some clusters available in PCL2:

u2013CU -Cluster directory

u2013RG -Payroll results (GB)

u2013B2 -Time management results

u2013ZL-Personal shift plan

u2013PS-Generated schema

u2013PT-Texts for generated schema

u2022Data is stored in CLUSTD field.

u2013To optimise data selection, RGDIR table of cluster CU is replicated into HRPY_RGDIR.

u2022Using LDB for HR-PY programming:

u2013PYORGSCREEN and PYTIMESCREEN need to be declared in TABLES statement for the extra payroll related selection-screen.

u2013PAYROLL node to be declared in the NODE statement with reference type to PAYGB_RESULT for UK or PAY99_RESULT for international.

u2013HR report category can be changed to use Payroll Results (Cluster) for selection screen customisation.

u2022GET PAYROLL.u2013PAYROLL structure will be populated. If more than one payroll period is specified at the selection screen, this event will be executed for each period.

u2013Payroll results internal table may contains more than one resultdepending on the u2018status of resultu2019selection.

u2013To evaluate payroll result, LOOP through the

PAYROLL-INTER-RT internal table.

-


First Using Get peras event read the RGDIR results as below

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

persnr = p_pernr

IMPORTING

molga = p_molga

TABLES

in_rgdir = p_rgdir

EXCEPTIONS

no_record_found = 1

OTHERS = 2.

Get the Cluster ID based on the molga value of the employee using T5001 table

Then Based on the RGDIR results loop retrive the payroll results below

LOOP AT gt_rgdir INTO wa_rgdir WHERE fpbeg LE wa_dates-endda AND fpend GE wa_dates-endda

AND srtza EQ c_a

AND payty EQ c_space.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

clusterid = wa_t500l-relid

employeenumber = pernr-pernr

sequencenumber = wa_rgdir-seqnr

read_only_international = 'X'

CHANGING

payroll_result = gt_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

error_reading_archive = 8

error_reading_relid = 9

OTHERS = 10.

EX:

TABLES: RP50G,PERNR,PYORGSCREEN,PYTIMESCREEN.

DATA: IN_RGDIR LIKE PC261 OCCURS 0 WITH HEADER LINE,

WA_RT LIKE PC207 OCCURS 0 WITH HEADER LINE,

SEQNR LIKE PC261-SEQNR,

RESULT TYPE PAY99_RESULT.

DATA: M_START LIKE SY-DATUM,

M_END LIKE SY-DATUM.

FORM GET_PAYROLL USING P_PERNR M_START M_END.

*This FM help us to get the Sequence number used for the

*employee on the payroll.

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

PERSNR = P_PERNR

TABLES

IN_RGDIR = IN_RGDIR

EXCEPTIONS

NO_RECORD_FOUND = 1

OTHERS = 2.

*We read it using two dates, which corresponds to the month *we need

READ TABLE IN_RGDIR WITH KEY FPBEG = M_START

FPEND = M_END.

SEQNR = IN_RGDIR-SEQNR.

*This FM actually reads the payroll and get the information

*we need.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

CLUSTERID = 'XX'

*In CLUSTERID use the country of your choice

EMPLOYEENUMBER = P_PERNR

SEQUENCENUMBER = SEQNR

READ_ONLY_INTERNATIONAL = 'X'

CHANGING

PAYROLL_RESULT = 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.

*We just need to read the result table.

LOOP AT RESULT-INTER-RT INTO WA_RT.

CASE WA_RT-LGART.

WHEN '9010'.

MOVE WA_RT-BETRG TO T_ANYTABLE-SOMEPAY.

ENDCASE.

ENDLOOP.

ENDFORM.

If helpful needs to appreciated.

Regards