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: 

Connection to SQL Server Database

Former Member
0 Kudos

I am working on 4.6C. How can i connect to SQL Sever database ? I am new to this type of concept. Kindly do provide some suggessions !!!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I came across the SAP Note 178949. Has anyone implemented this type of connection ?

9 REPLIES 9

Former Member
0 Kudos

Hi,

In general, if we want to hit database directly, we use..

EXEC.

ENDEXEC.

ex:

DATA: BEGIN OF wa,

connid TYPE spfli-connid,

cityfrom TYPE spfli-cityfrom,

cityto TYPE spfli-cityto,

END OF wa.

DATA c1 TYPE spfli-carrid VALUE 'LH'.

EXEC SQL PERFORMING loop_output.

SELECT connid, cityfrom, cityto

INTO :wa

FROM spfli

WHERE carrid = :c1

ENDEXEC.

FORM loop_output.

WRITE: / wa-connid, wa-cityfrom, wa-cityto.

ENDFORM.

0 Kudos

HI RamMohan,

I agree with your code of connecting to the database of ours. How to connect to the external SQL Server database ?

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

I came across the SAP Note 178949. Has anyone implemented this type of connection ?

0 Kudos

Check SAP Note 323151 Several DB connections with Native SQL

Former Member
0 Kudos

Manjunath CN

Hi,

Your didnu2019t separately install SQL Server database, only for SAP recommend SQL server dada base connected ,

Regards,

Ansari.

0 Kudos

Hi,

Refer this post, steps are mentioned regarding establishing connection to external database. Transaction DBCO will be used for that. Ask your BASIS guy to do this.

Example code is also mentioned which also help.

[https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=7272587]

Hope this one helps you alot.

Regards,

Brajvir

0 Kudos

Hi,

from the sequence of replies, I would like to say a word like,

Instead of using the EXECUTE statements to connect to that database, get their data, cant we Create a BOR object(BAPI) and give them so as to pass the data. Based on that data, we will do the transactions in SAP.

Kindly let me know the comments.

0 Kudos

i go with ur idea, infact SAP do the same with other instances.

thanq

Edited by: SAP ABAPer on Apr 9, 2009 7:53 AM