Sei sulla pagina 1di 9

ayroll 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 HR
PY_RGDIR.
u2022Using LDB for HR-PY programming:
u2013PYORGSCREEN and PYTIMESCREEN need to be declared in TABLES statement for th
e extra payroll related selection-screen.
u2013PAYROLL node to be declared in the NODE statement with reference type to PA
YGB_RESULT for UK or PAY99_RESULT for international.
u2013HR report category can be changed to use Payroll Results (Cluster) for sele
ction screen customisation.
u2022GET PAYROLL.u2013PAYROLL structure will be populated. If more than one payr
oll 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 o
n 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_dat
es-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
Alert Moderator Like (0)
Re: Using PNPCE LdB in Payroll.
Hemendra Sabharwal Bronze
Hemendra Sabharwal Jul 4, 2008 6:49 AM (in response to ranjna sharma)
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 HR
PY_RGDIR.
u2022Using LDB for HR-PY programming:
u2013PYORGSCREEN and PYTIMESCREEN need to be declared in TABLES statement for th
e extra payroll related selection-screen.
u2013PAYROLL node to be declared in the NODE statement with reference type to PA
YGB_RESULT for UK or PAY99_RESULT for international.
u2013HR report category can be changed to use Payroll Results (Cluster) for sele
ction screen customisation.
u2022GET PAYROLL.u2013PAYROLL structure will be populated. If more than one payr
oll 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 o
n 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_dat
es-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.

Potrebbero piacerti anche