Skip to Content
author's profile photo Former Member
Former Member

Native SQL throwing 'CX_SY_NATIVE_SQL_ERROR' exception

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 02, 2015 at 12:11 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.