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

Retrieve record from RT

Former Member
0 Likes
765

Hi!

I used FM CU_READ_RGDIR and get the last record. Now I would like to retrieve another record from RT according to the date, is it possible?

How can I get records from RT?

Please kindly advice & thanks for all help!

cheers,

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
0 Likes
712

Check this code.

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

persnr = p0001-pernr

  • BUFFER =

  • NO_AUTHORITY_CHECK = ' '

  • IMPORTING

  • MOLGA =

TABLES

in_rgdir = rgdir

EXCEPTIONS

no_record_found = 1

OTHERS = 2

.

  • IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

CALL FUNCTION 'CD_READ_LAST'

EXPORTING

begin_date = pn-begda "give ur period end date

end_date = pn-endda "give ur period end date

IMPORTING

out_seqnr = seqnr

TABLES

rgdir = rgdir

EXCEPTIONS

no_record_found = 1

OTHERS = 2.

  • IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

CHECK seqnr NE ' '.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

  • CLUSTERID =

employeenumber = p0001-pernr

sequencenumber = seqnr

  • READ_ONLY_BUFFER = ' '

  • READ_ONLY_INTERNATIONAL = ' '

  • ARC_GROUP = ' '

check_read_authority = 'X'

filter_cumulations = 'X'

  • CLIENT =

  • IMPORTING

  • VERSION_NUMBER_PAYVN =

  • VERSION_NUMBER_PCL2 =

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

error_reading_archive = 8

error_reading_relid = 9

OTHERS = 10

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

LOOP AT result-rt INTO result1 WHERE lgart = '/557' .

IF result1-betrg NE ' ' .

int_tab1-betrg = result1-betrg .

int_tab1-pernr = p0001-pernr .

int_tab1-werks = p0001-werks .

int_tab1-ename = p0001-ename .

int_tab1-orgeh = p0001-orgeh .

int_tab1-btrtl = p0001-btrtl .

int_tab1-vdsk1 = p0001-vdsk1 .

INSERT table int_tab1.

ENDIF .

ENDLOOP .

Regards,

Amit

Reward all helpful replies.

6 REPLIES 6
Read only

suresh_datti
Active Contributor
0 Likes
712

You have to pass the seqnr to the read_payroll_result function call..Pl check this

~Suresh

Read only

amit_khare
Active Contributor
0 Likes
713

Check this code.

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

persnr = p0001-pernr

  • BUFFER =

  • NO_AUTHORITY_CHECK = ' '

  • IMPORTING

  • MOLGA =

TABLES

in_rgdir = rgdir

EXCEPTIONS

no_record_found = 1

OTHERS = 2

.

  • IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

CALL FUNCTION 'CD_READ_LAST'

EXPORTING

begin_date = pn-begda "give ur period end date

end_date = pn-endda "give ur period end date

IMPORTING

out_seqnr = seqnr

TABLES

rgdir = rgdir

EXCEPTIONS

no_record_found = 1

OTHERS = 2.

  • IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

CHECK seqnr NE ' '.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

  • CLUSTERID =

employeenumber = p0001-pernr

sequencenumber = seqnr

  • READ_ONLY_BUFFER = ' '

  • READ_ONLY_INTERNATIONAL = ' '

  • ARC_GROUP = ' '

check_read_authority = 'X'

filter_cumulations = 'X'

  • CLIENT =

  • IMPORTING

  • VERSION_NUMBER_PAYVN =

  • VERSION_NUMBER_PCL2 =

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

error_reading_archive = 8

error_reading_relid = 9

OTHERS = 10

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

LOOP AT result-rt INTO result1 WHERE lgart = '/557' .

IF result1-betrg NE ' ' .

int_tab1-betrg = result1-betrg .

int_tab1-pernr = p0001-pernr .

int_tab1-werks = p0001-werks .

int_tab1-ename = p0001-ename .

int_tab1-orgeh = p0001-orgeh .

int_tab1-btrtl = p0001-btrtl .

int_tab1-vdsk1 = p0001-vdsk1 .

INSERT table int_tab1.

ENDIF .

ENDLOOP .

Regards,

Amit

Reward all helpful replies.

Read only

0 Likes
712

Hi all,

Thanks for helping me resolve my program..

br,

ying

Read only

former_member194669
Active Contributor
0 Likes
712

Hi,

Please look at program EXAMPLE_PNP_GET_PAYROLL.

aRs

Read only

Former Member
0 Likes
712

hi amit

your code is very useful but i have few queries.

like what is the structure of result and results1.

coz i am using your code and giving the results same as pc261 but its not showing any output

so if you can tell me about the structures of both ie. result and results 1 i an can proceed further

waiting for your reply

Read only

0 Likes
712

'result' should be typed according to the country for which you are interested in getting the results. It should be in format payXX_result where XX stands for the country code. For example PAYUS_RESULT or PAY99_RESULT. Let the forum know if that helped!