‎2007 Mar 21 1:26 AM
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,
‎2007 Mar 21 1:31 AM
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.
‎2007 Mar 21 1:30 AM
‎2007 Mar 21 1:31 AM
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.
‎2007 Mar 21 2:43 AM
‎2007 Mar 21 1:47 AM
‎2007 May 16 6:28 AM
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
‎2008 Apr 17 11:41 PM
'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!