Hi All,
I have written a native sql query in my report and it s working fine in development query.
But in case of training environment it is throwing 'CX_SY_NATIVE_SQL_ERROR' exception:
EXEC SQL.
OPEN C1 FOR
SELECT *
FROM <table name>
WHERE ( UPPER(<field name>) like :lv_facilitydesc
or <field name>like :lv_facilitydesc )
and <field name>= :lv_delivery_office
AND <field name>= :SY-MANDT
ENDEXEC.
DO.
count = count + 1.
EXEC SQL.
FETCH NEXT C1 INTO :ls_data // This is the statement which is throwing exception
ENDEXEC.
IF sy-subrc <> 0.
EXIT.
ENDIF.
APPEND ls_data TO lt_data.
ENDDO.
Please help.