‎2008 Apr 27 6:52 AM
How can i connect SAP Database to External database?
How can i update external databas from SAP withouting using BI/BW, Workflow or Net Weaver?
If anyone know please let me inform.
Thanks in Advance.
Jahnavee Trivedi
‎2008 Apr 28 10:43 AM
Hi,
run transaction DBCO ( manages DB connections ).
Fill fields:
- connection name
- connection type (see match code)
- DB user / password
- Connection string
You should contact the DB administrator to have those informations.
Now in your ABAP code, you can connect to the DB using instruction
EXEC SQL.
CONNECT TO <connection name>
ENDEXEC.Open a cursor for your select statement
EXEC SQL.
OPEN cursor1 FOR SELECT ....
ENDEXEC.Get data using the cursor (and fill ABAP variables)
DATA:
var1 TYPE ....
var2 TYPE ...
EXEC SQL.
FETCH NEXT cursor1 INTO :var1, :var2
ENDEXEC.Press F1 on EXEC statement to get more detailed informations from ABAP online help
Please remember to reward points for useful answers.
Best regards,
Manuel
‎2008 Apr 27 9:45 AM
Hi,
instead of using OpenSQL you can use Native SQL. Just look for Native SQL in SAP documentation.
[url]http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm[url]
Cheers
‎2008 Apr 28 12:07 AM
Hi Jahn,
if the external database is one that is supported by SAP you can use a technique called DB Multiconnect.
Search the SAP documentation and notes for this term and you will find how to do it.
Cheers
Graham Robbo
‎2008 Apr 28 10:43 AM
Hi,
run transaction DBCO ( manages DB connections ).
Fill fields:
- connection name
- connection type (see match code)
- DB user / password
- Connection string
You should contact the DB administrator to have those informations.
Now in your ABAP code, you can connect to the DB using instruction
EXEC SQL.
CONNECT TO <connection name>
ENDEXEC.Open a cursor for your select statement
EXEC SQL.
OPEN cursor1 FOR SELECT ....
ENDEXEC.Get data using the cursor (and fill ABAP variables)
DATA:
var1 TYPE ....
var2 TYPE ...
EXEC SQL.
FETCH NEXT cursor1 INTO :var1, :var2
ENDEXEC.Press F1 on EXEC statement to get more detailed informations from ABAP online help
Please remember to reward points for useful answers.
Best regards,
Manuel