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

Connection to SQL Server Database

Former Member
0 Likes
1,115

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
Read only

Former Member
0 Likes
1,058

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,058

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.

Read only

0 Likes
1,058

HI RamMohan,

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

Read only

Former Member
0 Likes
1,058

This message was moderated.

Read only

Former Member
0 Likes
1,059

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

Read only

0 Likes
1,058

Check SAP Note 323151 Several DB connections with Native SQL

Read only

Former Member
0 Likes
1,058

Manjunath CN

Hi,

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

Regards,

Ansari.

Read only

0 Likes
1,058

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

Read only

0 Likes
1,058

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.

Read only

0 Likes
1,058

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