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: 

Get data from external database

Former Member
0 Kudos

Hi,

I need to get some data from an external database (sql server).

--> I must make some request from my abap program to the sql server

Is there some RFC or ADO equivalent in sap ?

Any idea ? : )

Thx,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check these.

[http://www.sapfans.com/sapfans/forum/intface/messages/4013.html]

and one solution with code here.

[http://sap.ittoolbox.com/groups/technical-functional/sap-dev/connecting-sql-server-from-abap-627539]

Rhea.

6 REPLIES 6

Former Member
0 Kudos

Hi,

Check these.

[http://www.sapfans.com/sapfans/forum/intface/messages/4013.html]

and one solution with code here.

[http://sap.ittoolbox.com/groups/technical-functional/sap-dev/connecting-sql-server-from-abap-627539]

Rhea.

Former Member
0 Kudos

I heard about table DBCON which could be usqed with an EXCED SQL statement.

->Someone know how to configure DBCON to connect to an external database (mss) ?

It would be the better solution for my program but I ve never seen any sample use it 😕

0 Kudos

Read this

[HELP|http://help.sap.com/saphelp_nw70/helpdata/en/9c/d736b880c34f76b507bac7751a0474/content.htm]

[http://www.sapfans.com/forums/viewtopic.php?t=53626&highlight=dbcon+aix]

[http://www.sapfans.com/forums/viewtopic.php?f=13&t=257505&p=935274]

Rhea.

Former Member
0 Kudos

Thx for replies,

I have data in an MicrosoftSqlServer and I must import them into my SAP system.

I would like to get the data with native SQL like this way :


tables: dbcon.

 
data: FLAG_CONNECTED(1),
      v_conn like dbcon-CON_NAME.
 
*v_conn = 'MAR62'.

select single con_name from dbcon into v_conn where DBMS = 'MSS'.

 
EXEC SQL.
 
        set connection :v_conn
ENDEXEC.

-> I have made an entry in DBCON and i ve try to add it in DBACOCKPIT but I get an error :

function unit: DB6_DIAG_GET_SYSTEM_BASICS

method : SYNCHRONIZE_SYSTEM_DATA

REASON : ADBC ERROR

What is the excact way to run my sample ?

thx for replies : )

Former Member
0 Kudos

Hi,

Follow these notes 323151 and 178949. And search in SAP Market place there are many notes to help you.

Rhea.

Former Member
0 Kudos

Hi,

Try This

EXEC SQL.

CONNECT TO 'FP_CONNECT'

ENDEXEC.

IF sy-subrc NE 0.

WRITE / 'CONNECTION FAILED' COLOR COL_NEGATIVE.

ENDIF.

EXEC SQL PERFORMING READ_DATA.

SELECT *

FROM TABLE

INTO STRUCTURE.

ENDEXEC

FORM READ_DATA.

WRITE : / STRUCTURE.

ENDFORM

Hope this will read data from External Data base table or view.

Thanks,

Kishore