Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating DB link in SAP ABAP to retrieve data from external system

Former Member
0 Kudos

Hi gurus, Hope you all are fine. I have a requirement in which i have to retrieve data from external system database (Oracle) and then need to post it in SAP FI. I have never done this before. Can anybody tell me step by step how can i create DB link in SAP to access external system tables and what ABAP code need to write for it? Kindly guide step by step. I will much appreciate that.

Thanks

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Look at tool as ADBC - ABAP Database Connectivity  to execute SQL statement (OO substitute of native SQL statements), but first you need to actually connect database.

This part is not related to Abap : For Information on a tool as DB connect, look at document DB Connect Architecture and reference note 323151 - Several DB connections with Native SQL. Not that Basis will be required to install some component to access a database type distinct from current one (An other manufacturer, e.g. access Oracle if SAP running on MS SQL)

NB: You could also perform some search on UD Connect (uses Application Server J2EE connectivity)

Regards,

Raymond

6 REPLIES 6

raymond_giuseppi
Active Contributor
0 Kudos

Look at tool as ADBC - ABAP Database Connectivity  to execute SQL statement (OO substitute of native SQL statements), but first you need to actually connect database.

This part is not related to Abap : For Information on a tool as DB connect, look at document DB Connect Architecture and reference note 323151 - Several DB connections with Native SQL. Not that Basis will be required to install some component to access a database type distinct from current one (An other manufacturer, e.g. access Oracle if SAP running on MS SQL)

NB: You could also perform some search on UD Connect (uses Application Server J2EE connectivity)

Regards,

Raymond

0 Kudos

Dear Raymond, it seems like lot of work needs to be done for DB link. Actually i prefer integration through web services but here client is insisting for DB link. I did not find much about DB link on SCN. There is a link which i read. If you read this link, it seems quiet easy. SSAP DB Link to an External Oracle Database - Basis Corner - SCN Wiki.

Can you please look at this link and confirm do i need to do like this?

Thanks

0 Kudos

Dear Raymond,

Both SAP and external system are using oracle 11g database. But physically both databases are separate. Can you send any link or guide which tells making DB link in SAP to external system using oracle 11 g database?

Thanks

0 Kudos

So nothing to add to system.

Just execute DBCO transaciton and input information to be provided by your basis/database team (ORA, TNS name, id and password)

Then back to Abap and either native SQL or ADBC classes.

Regards,

Raymond

0 Kudos

Dear Raymond,

Ok  i need to put some information in DBCO. Where will i need to put TNS information? Do i nned to put information in DBACOCKPIT  as well?

Some thread says that i make z table exactly like the the table in other system. Than i need to make view of that table as well? Can you please further guide on this?

Thanks

0 Kudos

TNS info should be copied into conn. info field. (Just press F1 on the field in the new entry dynpro od DBCO)


Connection name  Logical name of the connection

DBMS             ORA

User name        Oracle user

DB password      Password for the Oracle user mentioned above

Conn.info        TNS alias

Permanent        Should not normally be set for a secondary connection.

AFAIK DBACockpit should not be required (but ask your basis too)

If you define a structure (no actual database table required) with same definition it would be easier to map result of fetch data, but this is not mandatory. Else you have to map field by field in select statement. - Look at EXEC SQL documentation for SELECT and CURSOR / FETCH statements.

Regards,

Raymond