Skip to Content

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

Problem while working with function module RFC_READ_TABLE

Dear Experts,

I am facing a problem while working on the FM RFC_READ_TABLE, in which there is a tables parameter options which is of table type, to which I am passing the condition of selection. In the debugg mode I found the select quiry in the source code of function module is not executing the condition passed in the options parameter.

My actual requirement is to fetch all the custom programs in a remote server, the code I have written is below.

TYPES :

BEGIN OF ty_tadir,

pgmid TYPE pgmid,

object TYPE trobjtype,

obj_name TYPE sobj_name,

END OF ty_tadir.

DATA : it_tadir TYPE STANDARD TABLE OF ty_tadir,

wa_tadir TYPE ty_tadir.

data: stmp_dokhl like TAB512 occurs 100000 with header line.

data: options1 like rfc_db_opt occurs 10 with header line.

data: wa_options1 like line of options1.

data: nametab1 like rfc_db_fld occurs 10 with header line.

START-OF-SELECTION.

DATA : W_VALUE(5) TYPE C,

W_VALUE1(20) TYPE C.

W_VALUE1 = 'OBJ_NAME like'.

W_VALUE = 'z*'.

CONCATENATE 'OBJ_NAME LIKE' ' ''' W_VALUE '''' INTO OPTIONS1-TEXT.

CONCATENATE W_VALUE1 W_VALUE INTO wa_OPTIONS1-TEXT SEPARATED BY SPACE.

APPEND wa_OPTIONS1 to OPTIONS1.

CLEAR wa_OPTIONS1.

call function 'RFC_READ_TABLE'

destination 'zard'

exporting

query_table = 'TADIR' "'ZBANK_GUARANTEE'

tables

options = options1

fields = nametab1

data = stmp_dokhl

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 .

Please give me some inputs on this,

With warm regards,

Murthy.

Edited by: pr murthy on Sep 18, 2008 1:49 PM

Edited by: pr murthy on Sep 18, 2008 2:14 PM

Tags:
Former Member
Former Member replied

Hi

I have tried this and with small change this is working fine.

TYPES :

BEGIN OF ty_tadir,

pgmid TYPE pgmid,

object TYPE trobjtype,

obj_name TYPE sobj_name,

END OF ty_tadir.

DATA : it_tadir TYPE STANDARD TABLE OF ty_tadir,

wa_tadir TYPE ty_tadir.

data: stmp_dokhl like TAB512 occurs 100000 with header line.

data: options1 like rfc_db_opt occurs 10 with header line.

data: wa_options1 like line of options1.

data: nametab1 like rfc_db_fld occurs 10 with header line.

START-OF-SELECTION.

DATA : W_VALUE(5) TYPE C,

W_VALUE1(20) TYPE C.

W_VALUE1 = 'OBJ_NAME LIKE ''Z%'''.

wa_options1-text = w_value1.

APPEND wa_OPTIONS1 to OPTIONS1.

CLEAR wa_OPTIONS1.

call function 'RFC_READ_TABLE'

*destination 'zard'

exporting

query_table = 'TADIR' "'ZBANK_GUARANTEE'

tables

options = options1

fields = nametab1

data = stmp_dokhl

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 .

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