12-19-2008 5:15 PM
Hi Gurus,
I need to read a value that appears at:
Transaction: pc_payresult >> table: RT >> wage type: /700 (Wage/salary + ER contrs)
Is there any function module to read this information from the cluster?
Thanks in advance.
Bruno Silva
12-20-2008 7:20 AM
Hi,
I hope following code is usefull.
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
PERSNR = I_PERNO-PERNR
TABLES
IN_RGDIR = I_SEQNO
EXCEPTIONS
NO_RECORD_FOUND = 1
OTHERS = 2.
*----
GETTING THE SALARY DETAILS
LOOP AT I_SEQNO WHERE FPBEG BETWEEN W_STYEAR AND W_CURRENT AND SRTZA = 'A'.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
CLUSTERID = 'IN'
EMPLOYEENUMBER = I_PERNO-PERNR
SEQUENCENUMBER = I_SEQNO-SEQNR
READ_ONLY_INTERNATIONAL = 'X'
CHANGING
PAYROLL_RESULT = LSX_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.
PERFORM BIFURCATE_RT.
ENDLOOP.
*----
FORM
*----
FORM BIFURCATE_RT.
CLEAR: HEADER,W_BETRG.
LOOP AT LSX_RESULT-INTER-RT INTO HEADER WHERE ABART = '3' AND LGART = '8LTA'.
ENDLOOP.
ENDFORM.
12-19-2008 5:24 PM
12-20-2008 7:20 AM
Hi,
I hope following code is usefull.
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
PERSNR = I_PERNO-PERNR
TABLES
IN_RGDIR = I_SEQNO
EXCEPTIONS
NO_RECORD_FOUND = 1
OTHERS = 2.
*----
GETTING THE SALARY DETAILS
LOOP AT I_SEQNO WHERE FPBEG BETWEEN W_STYEAR AND W_CURRENT AND SRTZA = 'A'.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
CLUSTERID = 'IN'
EMPLOYEENUMBER = I_PERNO-PERNR
SEQUENCENUMBER = I_SEQNO-SEQNR
READ_ONLY_INTERNATIONAL = 'X'
CHANGING
PAYROLL_RESULT = LSX_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.
PERFORM BIFURCATE_RT.
ENDLOOP.
*----
FORM
*----
FORM BIFURCATE_RT.
CLEAR: HEADER,W_BETRG.
LOOP AT LSX_RESULT-INTER-RT INTO HEADER WHERE ABART = '3' AND LGART = '8LTA'.
ENDLOOP.
ENDFORM.
12-22-2008 2:51 PM
I Thanks for responding to my question.
With these two functions supposedly I can get the value.
But I have another problem is that I need to get these values by restricting period.
(For example I need of their value for the month of December.)
Is there any way I restrict the amount per month?
In my research I found the following function:
'CD_EVALUATION_PERIODS'
But I'm not understand how this works.
Someone can help me understand how it works?
Thanks in advance.
Bruno Silva
Edited by: Bruno Silva on Dec 22, 2008 3:52 PM
12-22-2008 3:11 PM
Hi Bruno,
What Pavan wrote is correct. Maybe some more explanation will help you.
Generally payroll results are stored in clusters. To see them run the program RPCLSTRT and provide pernr here. On the right you will see cluster directory, which stores all payroll periods with their results.
Now to access particular results (i.e.for December) you need to take on record of this cluster directory and extract it (open).
Below code does excatly same thing what Pavan provide but some comments may help you.
DATA: BEGIN OF it_rgdir OCCURS 0. "table for storing cluster directory
INCLUDE STRUCTURE pc261.
DATA: END OF it_rgdir.
"payroll results for Netherlands -> for your country provide structure PAYXX_RESULT,
"where XX - abbreviation of the country i.e. UK, IT, FR etc. Note! some are international then XX should be = 99
DATA: it_pay_result TYPE paynl_result,
wa_rt TYPE LINE OF hrpay99_rt. "structure for payroll results (only table RT)
"read cluster directory for an employee
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
persnr = pernr-pernr
TABLES
in_rgdir = it_rgdir
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
"process only records for December (open one entry from cluster directory)
LOOP AT it_rgdir WHERE FPPER eq '200812'
AND srtza EQ 'A'. "only active ones (those which in cluster directory have A at the beginning)
"get payroll result for this period (Decemeber)
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
clusterid = 'RN' "This is cluster ID for Netherlands, for different country there should be different
employeenumber = pernr-pernr
sequencenumber = it_rgdir-seqnr
CHANGING
payroll_result = it_pay_result "here will payroll results be stored
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.
IF sy-subrc = 0.
LOOP AT it_pay_result-inter-rt INTO wa_rt
WHERE lgart EQ '/700'. "read RT table with entry for WT /700
"your coding here
ENDLOOP.
I hope it is clearer now for you
Marcin
12-23-2008 10:33 AM
Thank you Marcin
Thanks to you I'm already getting the value that I want.
Thank you very much,
Best Regards
Bruno Silva