on 12-02-2015 8:22 AM
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.
Hi Richa,
The class CX_SY_NATIVE_SQL_ERROR has been released internally in SAP version 4.6C.
May be you can not use that one as reference.
Generally, if you see TRY...CATCH statement to handle error has been promoted by SAP from version 6.0 onwards.
please check the note SAP Note 1063473.
Thanks&Regards
Kalpana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Richa,
Could you please check "ls_data" columns, as per the code( Select * ) you are trying to fetch all columns from table. If "select *" is case then all the column should match with "LS_DATA".
If columns are not matching with LS_DATA then select only those column which are available in LS_DATA.
Hope this will help you.
Thanks & Regards,
Nikhil
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.