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: 

Access data from non-SAP database

Former Member
0 Kudos

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

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, it is, using Native SQL.

Regards,

Rich Heilman

0 Kudos

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

0 Kudos

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

0 Kudos

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

former_member181962
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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]