‎2007 Apr 20 9:53 AM
Hi all,
how can i read tables from another r/3-system within an abap report ? what are the steps necessary ? can you provide me with some sample code/instructions, please ?
Thank you!
‎2007 Apr 20 9:56 AM
YOu can use the RFC fm RFC_READ Table.
For advanced requirements, you can have a look at this blog.
sample usage:
fld-fieldname = 'OBJ_NAME'.
APPEND fld.
CONCATENATE 'Object = ' '''FORM''' INTO str.
opt-text = str.
APPEND opt.
CALL FUNCTION 'RFC_READ_TABLE'
destination TDEST "Create a destination in sm59 for the other system
EXPORTING
query_table = 'TADIR'
TABLES
OPTIONS = opt
fields = fld
data = dat
EXCEPTIONS
table_not_available = 1
table_without_data = 2
option_not_valid = 3
field_not_valid = 4
not_authorized = 5
data_buffer_exceeded = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Message was edited by:
Ravi Kanth Talagana
‎2007 Apr 20 9:56 AM
YOu can use the RFC fm RFC_READ Table.
For advanced requirements, you can have a look at this blog.
sample usage:
fld-fieldname = 'OBJ_NAME'.
APPEND fld.
CONCATENATE 'Object = ' '''FORM''' INTO str.
opt-text = str.
APPEND opt.
CALL FUNCTION 'RFC_READ_TABLE'
destination TDEST "Create a destination in sm59 for the other system
EXPORTING
query_table = 'TADIR'
TABLES
OPTIONS = opt
fields = fld
data = dat
EXCEPTIONS
table_not_available = 1
table_without_data = 2
option_not_valid = 3
field_not_valid = 4
not_authorized = 5
data_buffer_exceeded = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Message was edited by:
Ravi Kanth Talagana
‎2007 Apr 20 9:57 AM
‎2007 Apr 20 10:00 AM
‎2007 Apr 20 10:10 AM
Hi,
Create an RFC enabled function module in destination system and call it from source system with RFC destination.
Like :
CALL FUNCTION 'READ_DEST_TABLE'
destination DEST
TABLES
X_TABLE LIKE SPFLI.
Function code like:
select * from spfli
into table x_spfli.
Regards
L Appana