Skip to Content
0
Former Member
May 23, 2012 at 12:50 PM

RFC_READ_TABLE function module going for dump when variable given in options

490 Views

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.