Application Development 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: 

RFC_READ_TABLE function module going for dump when variable given in options

Former Member
0 Kudos

Hi Experts,

I am using fm RFC_READ_TABLE .
in options table parameter I am passing a variable of type date, and it is going for dump.
When I directly input the value to the options then no problem  , for example  vbeln = 12345345.
if we give variable ie Vbeln = lv_vbeln, probelm is comming.

Error analysis
    Short text of error message:
    Runtime error SAPSQL_WHERE_ILLEGAL_VALUE has occurred

    Long text of error message:
     Diagnosis
         Error texts from the batch input are not output
         Only a placeholder
     Procedure

    Technical information about the message:
    Message class....... 00
    Number.............. 341
    Variable 1.......... "SAPSQL_WHERE_ILLEGAL_VALUE"
    Variable 2.......... " "
    Variable 3.......... " "
    Variable 4.......... " "

lv_date = sy-datum.
wa_options-text = 'DATE = LV_DATE'.
APPEND wa_options TO tb_options.

CALL FUNCTION 'RFC_READ_TABLE' DESTINATION p_dest
  EXPORTING
    query_table          = 'ZNDCEPTDEX'
  TABLES
    OPTIONS              = tb_options
    fields               = tb_fields
    data                 = tb_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 <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

So how to handle this issue.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Can you try to concatenate?

Concatenate 'DATE  =' lv_Date into wa_options-text seperated by space.

APPEND wa_options TO tb_options.

4 REPLIES 4

former_member213851
Active Contributor
0 Kudos

Hi Shiva,

Please remove Quotes and Try :

wa_options-text = DATE = LV_DATE.

Regards Sachin.

0 Kudos

This we cannot give sachin , because if we remove quotes , then that statement does not make sense.

Former Member
0 Kudos

Can you try to concatenate?

Concatenate 'DATE  =' lv_Date into wa_options-text seperated by space.

APPEND wa_options TO tb_options.

former_member282968
Contributor
0 Kudos

Dear Shiva,

Instead of assigning directly use concatenate statement and assign the final variable.Like below:

CONCATENATE  var1 var2 INTO var3 SEPARATED BY space.

With regards,