Skip to Content
0
Former Member
Jun 29, 2007 at 01:33 AM

dynamic native sql error

11 Views

Hi,everyone:

Now I need to insert 60 sap-tables into A table not in sap DB ,according to a formula.so i need to use dynamic native sql, but i find it can not work.

a test example as follow: just as native sql in sap server.

TABLES mara.

DATA: l_matnr LIKE mara-matnr.

DATA: string(1000).

CONCATENATE 'SELECT matnr FROM MARA INTO :L_MATNR WHERE MATNR ='

'''27101921000'''

INTO string

SEPARATED BY space.

EXEC SQL.

:STRING

ENDEXEC.

WRITE: l_matnr.

system return :

SQL error "-104" occurred when executing EXEC SQL.

I wonder the right use of dynamic native sql .

Message was edited by:

Leibnitz.Pan