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

RFC_READ_TABLE

Former Member
0 Likes
1,136

Hi every body,

I am using RFC_READ_TABLE function module..to get the data from other systems.I am passing below condition in option parameter of the function module ..but it is not wroking .

could you plese correct me here.

below is code i am passing to options.

" trkorr in s_chtp"

regards,

vinesh.

2 REPLIES 2
Read only

Former Member
0 Likes
633

Hi

The RFC table uses dinamyc selection where the WHERE CONDITIONS are store in an internal table (just as the table of the interface). It uses this code:

SELECT * FROM (QUERY_TABLE) INTO WORK WHERE (OPTIONS).

In table OPTIONS u can transfer the WHERE conditions, but there are some limits, it's not possible to use all options, for example it can't transfer the SELECT-OPTIONS, so " trkorr in s_chtp" can't work.

U can only transfer a sinlge value: TRKORR = '123456789'.

Max

Read only

Former Member
0 Likes
633

try with this loop at select options ...pass each value and get the data..

LOOP AT I_DEP_FINAL.

REFRESH : I_OPTIONS.

CLEAR: I_OPTIONS,

W_VALUE.

W_VALUE = I_DEP_FINAL-TRKORR.

CONCATENATE 'TRKORR EQ ' ' ''' W_VALUE ''''

INTO I_OPTIONS-TEXT.

APPEND I_OPTIONS.

REFRESH: I_FIELDS.

CLEAR : I_FIELDS.

I_FIELDS-FIELDNAME = 'TRKORR'.

APPEND I_FIELDS.

REFRESH : I_DATA.

CALL FUNCTION 'RFC_READ_TABLE'

DESTINATION 'U-OFS-HR'

EXPORTING

QUERY_TABLE = 'E070'

TABLES

OPTIONS = I_OPTIONS

FIELDS = I_FIELDS

DATA = I_DATA

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

ENdif.

ENDLOOP.