Application Development and Automation 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: 
Read only

Access data from non-SAP database

Former Member
0 Likes
1,060

Hi guys,

I'm looking for a way to read data from a non-SAP database into SAP, if possible using some ABAP-coding. The external database probably does not reside on the same machine as the SAP-Applicsation server. Is this possible?

Thanks and regards

Jan

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
926

Yes, it is, using Native SQL.

Regards,

Rich Heilman

Read only

0 Likes
926

Hi,

sounds good, but how do i connect to the external db-server? I know that there is transaction DBCO, but it is not possible to specify an IP for the server?

Thanks and regards

Jan

Read only

0 Likes
926

I think the connection information field has the technical info related to the database:

<b>Database-specific information for a database

connection

This field contains the technical information that is analyzed in native

SQL in the CONNECT statement in order to open the database connection.

The exact information required depends on the database.

Oracle:

TNS name of the database to which you want to connect. </b>

Regards,

Ravi

Read only

0 Likes
926

Hi,

thanks for Your answers so far, but can anyone confirm how to set up the connection to a remote database (remote meaning, the database sits on different server than the application server)?

If this is done by transaction DBCO, how do I fill misterious field which "contains the technical information that is analyzed in native SQL in the CONNECT statement in order to open the database connection"?

Thanks and regards

Jan

Read only

Former Member
0 Likes
926

you can use native sql commands like

DATA: exc_ref TYPE REF TO cx_sy_native_sql_error,

error_text TYPE string.

TRY.

EXEC SQL.

INSERT INTO scarr

(MANDT, CARRID, CARRNAME, CURRCODE, URL)

VALUES ('000', 'FF', 'Funny Flyers', 'EUR',

'http://www.ff.com');

INSERT INTO scarr

(MANDT, CARRID, CARRNAME, CURRCODE, URL)

VALUES ('000', 'EF', 'Easy Flyers', 'EUR',

'http://www.ef.com');

ENDEXEC.

CATCH cx_sy_native_sql_error INTO exc_ref.

error_text = exc_ref->get_text( ).

MESSAGE error_text TYPE 'I'.

ENDTRY.

But you cannot use these statements which doesn't support native sql commands.

Regards,

ravi

Read only

Former Member
0 Likes
926

I think you can talk to your Basis team to set up the connection.

Or use :

EXEC SQL.

-> Connect :v_base.

ENDEXEC.

Or use the SELECT …….. FROM table_name@server_name

Please do reward if it helps you.

Regards,Felipe Cunha [FpdC]