Hi there, I'm trying to write some native SQL in abap but got some problems.
Here's my code:
method GET_SOMEDATA.
DATA: lt_table TYPE TABLE OF /BI0/TCUSTOMER,
c1 TYPE /BI0/TCUSTOMER.
DATA: BEGIN OF wa,
customer TYPE /BI0/OICUSTOMER,
txtsh TYPE RSTXTSH,
txtmd TYPE RSTXTMD,
txtlg TYPE RSTXTLG,
END OF wa.
EXEC SQL.
OPEN c1 FOR
SELECT * FROM /BI0/TCUSTOMER
WHERE customer LIKE '229'.
ENDEXEC.
DO.
EXEC SQL.
FETCH NEXT c1 INTO :wa-customer, :wa-txtmd
* ERROR: CX_SY_NATIVE_SQL_ERROR
ENDEXEC.
IF sy-subrc = 0.
* <process data>
ENDIF.
ENDDO.
EXEC SQL.
CLOSE c1
ENDEXEC.
endmethod.
After calling "FETCH NEXT c1 INTO :wa-customer, :wa-txtmd" I'm getting an "CX_SY_NATIVE_SQL_ERROR" - I guesse something with my cursor is not ok - but I have no idea. Some help would be great.