‎2012 Jan 09 10:41 AM
I have to fetch the data from table RT that is displayed when we execute the transaction PC_PAYRESULT.
When we double click on the alv displayed .
There are several tables displayed .
I have to fetch data from RT Results table .
I have to fetch data based on the wage type ,Pernr , Period .
What is the procedure to fetch such data ?
I tried finding it on net but i have no clue that the solution that i have got is correct .
‎2012 Jan 09 11:07 AM
If you look into program of this tcode it is calling various reports dynamically and you can submit the same report and use return statement.. After that you can import data from memory.
Nabheet
‎2012 Jan 09 5:51 PM
The first screen which appears can be fetched using function module CU_READ_RGDIR, then further
Read valid period from cluster directory using CU_READ_LAST
Read payroll results using PYXX_READ_PAYROLL_RESULTusing SEQNO returned by CU_READ_LAST
which returns RT, CRT etc
‎2012 Jan 10 7:11 AM
when we use the FM PYXX_READ_PAYROLL_RESULT
taking the input parameters as pernr , seqnr
as i execute it gives me a popup
as it contains no value specify a new value .
what should i enter there ?
‎2012 Jan 10 7:21 AM
Hi friend,
Its a common doubt.
In a function module if you don't specify values for any fields ie input parameters it asks for a default value.
just set default values for all the parameters and try executing the function module.
It will work fine. I used this function module for getting the payroll tables.
If you face any issues please revert back to em i will help you.
Thanks,
Sri Hari
‎2012 Jan 11 7:22 AM
Hello ,
Thanks for the reply .
i would like to know that if i go to get the RT TABLE value by first
going to the FM CU_READ_RGDIR
Then i try to fetch the data from the FM PYXX_READ_RGDIR_PAYRESULTS
in the first FM i do get the data in table but in second case i am not succesfull in getting data .
Can you suggest me any path of FM which i should folllow to get the result of RT table .
‎2012 Jan 10 7:25 AM
I have tried to use this below code in fetching the data but it fetches data only for RGDIR but not for RT .
can any one suggest that how do i fetch the data from RT table ...
i am either missing some Include or may be i am not writing the correct imp statement .
TABLES: t554s, pcl1, pcl2.
INCLUDE rpclst00.
INCLUDE rpc2rx09. "Payroll results datadefns-Intl.
INCLUDE rpc2rxx0. "Payroll results datadefns-Intl.
INCLUDE rpc2rgg0. "Payroll results datadefns-GB
INCLUDE rpcfdcg0. "Payroll results datadefns-GB
INCLUDE rpcdatg0.
INCLUDE rpc2cd00. "Cluster Directory defns.
INCLUDE rpc2ps00. "Cluster: Generierte Schematas
INCLUDE rpc2pt00.
INCLUDE rpcfdc10.
INCLUDE rpcfdc00.
INCLUDE rpppxd00.
INCLUDE rpppxd10.
INCLUDE rpcfvp09.
INCLUDE rpcfvpg0.
INCLUDE rpppxm00.
TYPES: BEGIN OF t_salrate,
seqnr TYPE pc261-seqnr,
begda TYPE p2001-begda,
endda TYPE p2001-endda,
split(2) TYPE c,
val TYPE p DECIMALS 2,
END OF t_salrate.
DATA: it_salrate TYPE STANDARD TABLE OF t_salrate INITIAL SIZE 0,
wa_salrate TYPE t_salrate.
*Selection screen
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: so_awart FOR p2001-awart.
SELECTION-SCREEN END OF BLOCK block1.
************************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.
GET pernr.
get payroll results data
rp-init-buffer.
CLEAR rgdir. REFRESH rgdir.
CLEAR rt. REFRESH rt.
CLEAR: rx-key.
set key to current pernr
MOVE pernr-pernr(8) TO cd-key-pernr.
retrieves payroll results for specific pernr(personnel number)
rp-imp-c2-cd.
IF rp-imp-cd-subrc = 0. "rgdir success
rx-key-pernr = pernr-pernr.
SORT rgdir BY seqnr ASCENDING.
CLEAR rgdir.
ENDIF.
SORT rgdir BY fpbeg fpend ASCENDING seqnr DESCENDING.
RGDIR the table where all payroll results periods are stored
LOOP AT rgdir WHERE abkrs IN pnpabkrs "pay area
AND srtza EQ 'A'
AND void NE 'V'.
IF sy-subrc NE 0.
set key to specific payroll results period(current RGDIR loop pass)
UNPACK rgdir-seqnr TO rx-key-seqno.
Retrieves data for specific payroll results period (current RGDIR
loop pass)
rp-imp-c2-rg.
Loop at wpbp data for specific payroll results period
LOOP AT wpbp.
wa_salrate-seqnr = rgdir-seqnr.
wa_salrate-begda = wpbp-begda.
wa_salrate-endda = wpbp-endda.
wa_salrate-split = wpbp-apznr.
loop at rt data for specific payroll results period
LOOP AT rt WHERE lgart EQ '/010' AND "wage type
apznr EQ wpbp-apznr. "payroll split
wa_salrate-val = ( rt-betpe * ( wpbp-adivi / wpbp-kdivi ) ).
APPEND wa_salrate TO it_salrate.
ENDLOOP.
ENDLOOP.
Process BT table
LOOP AT BT.
ENDLOOP.
Process NIPAY table
LOOP AT NIPAY.
ENDLOOP.
etc................
ENDIF.
ENDLOOP.
************************************************************************
*END-OF-SELECTION.
END-OF-SELECTION.