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: 

retrieving data through RT_

Former Member
0 Kudos

hi every body,

I have come across a problem I have access the data of RT using

for other period

call function 'CU_READ_RGDIR'

exporting

persnr = p0001-pernr

importing

molga = lv_molga

tables

in_rgdir = gs_rgdir.

sort gs_rgdir by seqnr.

CONCATENATE PNPPABRJ PNPPABRP into varfppr.

READ TABLE GS_rgdir into gs_rgdir WITH key fpper = varfppr.

SELECT SINGLE relid FROM t500l

INTO lv_relid

WHERE molga = lv_molga.

if sy-subrc = 0.

call function 'PYXX_READ_PAYROLL_RESULT'

exporting

clusterid = lv_RELID

employeenumber = p0001-pernr

sequencenumber = gs_rgDIR-SEQNR

read_only_international = 'X'

changing

payroll_result = result.

endif.

Now I have got all the required data in the RT but I need the most recent salary from the RT for the given month can some body tell me how to retrieve the data of the most recent salary through it. I have been using the other period option in it.

Edited by: ZAHID HAMEED on Jul 21, 2010 12:12 AM

5 REPLIES 5

Former Member
0 Kudos

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

employeenumber = p0001-pernr

sequencenumber = v_seqnr

CHANGING

payroll_result = wa_payresult

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

  • move payroll results to Internal tables

MOVE wa_payresult-inter-rt[] TO it_rt[] . "

MOVE wa_payresult-nat-bal[] TO it_bal[]. "

MOVE wa_payresult-nat-unb[] TO it_unbal[]."

sort the table by date and Read them.

0 Kudos

hi krk,

You have been using three different internal tables for fetching the data through result RT.

There is no date exist in the wa_result-inter-rt so by using three different tables how will I get the data from it by checking the dates.

Regards Zahid Hameed.

Former Member
0 Kudos

hi everybody,

My problem has been solved there is a field in the RT with the name apznr which contain the number of the recent values which are always lies with the max no. So I have retrieved the data to another internal table and then I sort the the internal table and get my required apznr values this value should be first in the new internal table. You will get your desired result in it.

call function 'CU_READ_RGDIR'

exporting

persnr = p0001-pernr

importing

molga = lv_molga

tables

in_rgdir = gs_rgdir.

sort gs_rgdir by seqnr.

concatenate pnppabrj pnppabrp into varfppr.

read table gs_rgdir into gs_rgdir with key fpper = varfppr.

select single relid from t500l

into lv_relid

where molga = lv_molga.

if sy-subrc = 0.

call function 'PYXX_READ_PAYROLL_RESULT'

exporting

clusterid = lv_relid

employeenumber = p0001-pernr

sequencenumber = gs_rgdir-seqnr

read_only_international = 'X'

changing

payroll_result = result.

endif.

loop at result-inter-rt into wa_rt.

move wa_rt-apznr to it_rt-apznr.

move wa_rt-lgart to it_rt-lgart.

move wa_rt-anzhl to it_rt-anzhl.

move wa_rt-betrg to it_rt-betrg.

append it_rt.

endloop.

sort it_rt by apznr ascending.

read table it_rt into wa_rt2 index 1.

*read table will return u the recent no of apznr to get the gross salrary from it.

read table it_rt into line_pssal-grosssalary where apznr = wa_rt2.

Then get the required result by checking the lgart from the RT.

Edited by: ZAHID HAMEED on Jul 21, 2010 9:47 PM

Edited by: ZAHID HAMEED on Jul 22, 2010 2:17 PM

Edited by: ZAHID HAMEED on Jul 22, 2010 2:21 PM

Former Member
0 Kudos

closed

Former Member
0 Kudos

closed