Hi folks !
This is my first blog post, I confess I am little nervous when i write it, first impressions are everything, right?
Well, let's talk of one of my favorite theme, the statement "EXEC SQL" (Native SQL).
Native SQL allows you to use database-specific SQL statements in an ABAP program. This means that you can use database tables that are not managed by the ABAP Dictionary, Its usefull when integrate another system through SAP.
Example 1 (Selecting one field) in Oracle:
TYPES: BEGIN OF wa_dual,
txt TYPE string,
END OF wa_dual.
CONSTANTS: c_conn TYPE char20 VALUE 'db_con'.
EXEC SQL.
CONNECT TO :c_conn
ENDEXEC.
EXEC SQL PERFORMING F_SINGLE_LINE_PRINT.
SELECT 'I LIKE WRITE SQL'
FROM dual
INTO :wa_dual
ENDEXEC.
FORM F_SINGLE_LINE_PRINT.
WRITE: / wa_dual-txt.
ENDFORM.
But, its a good pratice use it, knowing that there arevarious forms ofintegration (RFC, Webservice, etc)?!