Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Retrieving data from the table TCRT

Hi experts ,

I am not able to retrieve data from the table TCRT.

I have used the functional module CU_READ_RGDIR to retrieve sequence number .

and PYXX_READ_PAYROLL_RESULT to get payroll result .

but this is not retrieving TCRT table alone .

Is there any function module which can retrieve data from TCRT table ?

Thanks

Kavitha

Tags:
Former Member
Former Member replied

hi,

I am sending total code. I hope it will surely solve ur problem.

REPORT ZSHAN_HR350_PAYRESULT_US.

data begin of rgdir occurs 10.

INCLUDE STRUCTURE pc261.

DATA end of rgdir.

DATA: WA_RGDIR LIKE LINE OF RGDIR.

data: country like t500l-molga.

data: seqnumber like pc261-seqnr,

payroll type payUS_result,

rtline type line of hrpayUS_TCRT.

data: itab_t512t like table of t512t with header line.

DATA: begin of final,

LGART LIKE PC23H-LGART,

LGTXT LIKE T512T-LGTXT,

BETRG LIKE PC23H-BETRG,

end of final.

DATA: RESULT_TAB LIKE TABLE OF FINAL WITH HEADER LINE.

parameters: pernr like pernr-pernr.

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

PERSNR = PERNR

  • BUFFER =

  • NO_AUTHORITY_CHECK = ' '

IMPORTING

MOLGA = COUNTRY

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.

SORT RGDIR DESCENDING BY SEQNR.

READ TABLE RGDIR INTO WA_RGDIR INDEX 1.

MOVE WA_RGDIR-SEQNR TO SEQNUMBER.

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

CLUSTERID = 'RU'

EMPLOYEENUMBER = PERNR

SEQUENCENUMBER = SEQNUMBER

  • 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 = PAYROLL

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.

select * from t512t into table itab_t512t where molga eq '10'

AND sprsl eq 'E'.

sort itab_t512t ascending by lgart.

sort payroll-NAT-TCRT ascending by lgart.

LOOP AT PAYROLL-NAT-TCRT INTO RTLINE.

READ TABLE ITAB_T512T WITH KEY LGART = RTLINE-LGART.

MOVE RTLINE-LGART TO RESULT_TAB-LGART.

MOVE ITAB_T512T-LGTXT TO RESULT_TAB-LGTXT.

MOVE RTLINE-BETRG TO RESULT_TAB-BETRG.

APPEND RESULT_TAB.

ENDLOOP.

LOOP AT RESULT_TAB.

WRITE: / RESULT_TAB-LGART,RESULT_TAB-LGTXT, RESULT_TAB-BETRG.

ENDLOOP.

Regards,

Shankar.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question