‎2013 Aug 12 12:34 PM
Hi Abap developers,
We need to connect SAP with an external Oracle database. We will need to read and to write Oracle database.
We create a simple report only to make some tests. The source code is the following. It is working fine.
But my question is where can i find a complete documentation about this Native SQL and samples with code about theses issues.
If you want purpose another way to connect the databases you will be welcome too.
Than you and best regards
JFernandes
*&---------------------------------------------------------------------*
*& Report ZTESTE_LIG
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZTESTE_LIG.
DATA: CONNECTION LIKE DBCON-CON_NAME VALUE 'VSALES'.
data: canal like VBRK-VTWEG.
data: begin of itab occurs 100,
aca_codemp type i,
aca_coddel type i,
end of itab.
EXEC SQL.
CONNECT TO :CONNECTION
ENDEXEC.
IF SY-SUBRC = 0.
EXEC SQL.
SET CONNECTION :CONNECTION
ENDEXEC.
refresh itab.
EXEC SQL.
SELECT ACA_CODEMP, ACA_CODDEL
INTO :ITAB
FROM
ZZ_ARTCANAL
ENDEXEC.
append itab.
loop at itab.
write: itab-aca_codemp, itab-aca_coddel.
endloop.
EXEC SQL.
SET CONNECTION DEFAULT
ENDEXEC.
EXEC SQL.
DISCONNECT :CONNECTION
ENDEXEc.
ENDIF.
‎2013 Aug 12 1:19 PM
You would probably need to look around on Oracle's web site to find such documentation of their SQL dialect.
Let me suggest you also check out ABAP database connectivity (ADBC) for this purpose, allowing to access external databases in an OO fashion:
http://help.sap.com/abapdocu_740/en/abenadbc.htm
Thomas
‎2013 Aug 12 1:19 PM
You would probably need to look around on Oracle's web site to find such documentation of their SQL dialect.
Let me suggest you also check out ABAP database connectivity (ADBC) for this purpose, allowing to access external databases in an OO fashion:
http://help.sap.com/abapdocu_740/en/abenadbc.htm
Thomas