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

find error in code

Former Member
0 Likes
630

Hi Gurus,

  Can any one tell me , why  function module is not  selecting data based on options ?

DATA: l_be_log_system1
TYPE be_log_system,



lt_options1 TYPE TABLE OF rfc_db_opt,

ls_options1 LIKE LINE OF lt_options1,



i_fields1 TYPE TABLE OF rfc_db_fld,

wa_fields1 TYPE rfc_db_fld,

i_data1 TYPE TABLE OF tab512,

wa_data1 TYPE tab512.

data: line type line .



l_be_log_system1 = es_item-be_log_system.

*************** FOR OPTIONS

READ TABLE i_account into wa_account with KEY order_no = '001000007336'.



concatenate 'order_no = ''' wa_account-order_no '''' into line .

move: line to ls_options1 .

append ls_options1 to lt_options1 .

************** FOR FIELDS

wa_fields1-fieldname = 'AUFNR'.

APPEND wa_fields1 TO i_fields1.



CALL FUNCTION 'RFC_READ_TABLE' DESTINATION l_be_log_system1

EXPORTING

query_table = 'COAS'

TABLES

OPTIONS = lt_options1

fields = i_fields1

data = i_data1

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.

Thanks in Advance

Hari Gutti

3 REPLIES 3
Read only

rosenberg_eitan
Active Contributor
0 Likes
609

Hi,

What do you have in sy-subrc after the call ?

Regards

Read only

RaymondGiuseppi
Active Contributor
0 Likes
609

Did you forgot to add a OR between each selection criteria (or refresh the itab)?

If the target is a SAP system, does your table COAS actually contain a field "order_no"?

Did you always monitor sy-subrc?

Regards,

Raymond

Read only

Former Member
0 Likes
609

hi hari

problem seems to be here in this code

concatenate 'order_no = ''' wa_account-order_no '''' into line .

***move: line to ls_options1 .

ls_options1 = 'order_no = 1234'.

append ls_options1 to lt_options1 .

here lt_options1 is internal table

if this is selection options then you have to give high or low value