ERP Database - The Unofficial ERP Knowledge Base

Facebook Twitter del.icio.us Digg it
ERP Database contains a huge collection of articles related to ERP System and Software. Many of the articles are specifically related to SAP. All these ERP/SAP articles are freely available to everyone.

If you would like to submit an article or share any document related to ERP or any specific ERP software. Please mail it to support@erpdb.info. Please make sure that the documents are not copyrighted.
Social Bookmarks:

Native SQL

Print This Post Email This Post Written by admin on Jul 30th, 2008 | Filed under: ABAP

Native SQL statements allow you to access the data directly from the Database. The developer can directly write database specific SQL statements in the ABAP program using the keyword EXEC SQL … ENDEXEC.

Here is how the actual syntax goes.

EXEC SQL [PERFORMING <form>].
Native SQL Statements
ENDEXEC.

Here is the actual example:

EXEC SQL PERFORMING loop_output.
SELECT connid, cityfrom, cityto
INTO :wa
FROM spfli
WHERE carrid = :c1
ENDEXEC.

FORM loop_output.
WRITE: / wa-connid, wa-cityfrom, wa-cityto.
ENDFORM.

Remember there is no period(.) in the end of the statements and you cannot use comments like (“) or (*) in inside the native SQL statements.

Share


Leave a Reply