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: 

Connecting to external SQL Server DB from SAP(which is on unix and Oracle)

Former Member
0 Kudos

Dear Experts,

I need to connect SQL server database from SAP (which is on Unix and Oracle).

Anybody help me on this.

Thanks

Rays

1 ACCEPTED SOLUTION

Former Member
0 Kudos

For for successfully connecting to an external SQL Server DB with:

--> DBCON --> 3 parts are required:

1) You need to have the database client of the external RDBMS installed on your system - in this case the SQL Server Client Software

2) You need to download the DBSL for the external RDBMS in your kernel directory - for SQL Server it is called dbmssslib.dll (see SAP note #19466)

3) You need to add an entry to table DBCON which contains the connection details.

Restriction:

you need to have at least one Windows Application Server in your system to establish a connection using DBCON, why?

The reason is, that the SQL Server Client Software is developed by Microsoft and therefore not available for non-Microsoft Operating systems. As there is no client installation available anyways, SAP does not provide a DBSL (dbmssslib) for non Microsoft platforms.

--> UDConnect --> 3 parts are required:

Another option is to use UDConnect as described in SDN:

[UDConnect|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/58f4db47-0501-0010-a2bf-ff01b150fdff?overridelayout=true]

Restrictions:

You need to have a Java Application server in your system as for UDConnect, JDBC is used.

This is not the ideal connection type if you're planning to load a lot of data over this connection.

regards,

beate

10 REPLIES 10

Former Member
0 Kudos

Hi rayudu,

1. If your sap application server is unix/aix

(and not a microsoft OS),

2. then this kind of secondary databse connection,

to MS SQL (which is microsoft system),

is at present not possible.

(BCOS the required system files, for such

cross - platform connection is not delivery by sap)

regards,

amit m.

Former Member
0 Kudos

do u want to connect to third party for data transfer....then u need to use FTP concept.

0 Kudos

I need to transfer data from SQL Server DB to SAP(both in windows)

any one post the Idea What i have to do?

Former Member
0 Kudos

Dear Experts,

I need to dbconnect SQL server database from SAP BW(which is on Unix and Oracle).

As I know,I need to install dbsl for unix(dbmssslib.sl)

But I don't know how to install sql server client on unix server.

I search the SDN,Found that----"You need to install the BI java connectors.

Relational DB's: you need to install the BI JDBC connector ,once u r done with it you should be able to connect any rdbms.

"

Is it right ?

Anybody help me on this.

Thanks a lot

thomas

Former Member
0 Kudos

Hi

Connecting to an External database from SAP

Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.

Table: DBCON (Description of Database Connections)

Field Name Description Value (For: E.g.:)

CON_NAME Logical name for a RAJ

database connection

DBMS Database system MSS

USER_NAME Database user <username>

PASSWORD Password for setting up <pwd>/<pwd>

the connection to the database

CON_ENV Database-specific information MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE

DB_RECO Availability type for an open database connect

Step 2: Now you can write code to connect to the external database…

Your Sample code can be something like this……

FUNCTION-POOL z_houston. "MESSAGE-ID ..

DATA: BEGIN OF wa,

c_locid(3),

c_locname(50),

c_locstate(5),

END OF wa.

FUNCTION z_houston_connect.

*"----


""Local interface:

*"----


EXEC SQL.

CONNECT TO 'RAJ' AS 'V'

ENDEXEC.

EXEC SQL.

SET CONNECTION 'V'

ENDEXEC.

*- Get the data from MS-SQL Server

EXEC SQL.

open C1 for

select

loc_id,

loc_name,

loc_state

from ho_loc_mast

ENDEXEC.

DO.

EXEC SQL.

FETCH NEXT C1 into :wa-c_locid, :wa-c_locname, :wa-c_locstate

ENDEXEC.

IF sy-subrc = 0.

PERFORM loop_output.

ELSE.

EXIT.

ENDIF.

ENDDO.

EXEC SQL.

CLOSE C1

ENDEXEC.

ENDFUNCTION.

&----


*& Form LOOP_OUTPUT

&----


  • Output

----


FORM loop_output .

WRITE: /5 wa-c_locid, 10 wa-c_locname, 65 wa-c_locstate.

CLEAR wa.

ENDFORM. " LOOP_OUTPUT

Regards

Raj

Former Member
0 Kudos

For for successfully connecting to an external SQL Server DB with:

--> DBCON --> 3 parts are required:

1) You need to have the database client of the external RDBMS installed on your system - in this case the SQL Server Client Software

2) You need to download the DBSL for the external RDBMS in your kernel directory - for SQL Server it is called dbmssslib.dll (see SAP note #19466)

3) You need to add an entry to table DBCON which contains the connection details.

Restriction:

you need to have at least one Windows Application Server in your system to establish a connection using DBCON, why?

The reason is, that the SQL Server Client Software is developed by Microsoft and therefore not available for non-Microsoft Operating systems. As there is no client installation available anyways, SAP does not provide a DBSL (dbmssslib) for non Microsoft platforms.

--> UDConnect --> 3 parts are required:

Another option is to use UDConnect as described in SDN:

[UDConnect|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/58f4db47-0501-0010-a2bf-ff01b150fdff?overridelayout=true]

Restrictions:

You need to have a Java Application server in your system as for UDConnect, JDBC is used.

This is not the ideal connection type if you're planning to load a lot of data over this connection.

regards,

beate

0 Kudos

quick update:

I documented various questions regarding this topic in SAP KBA 1601608

DBACockpit Monitoring, Data Access and BI / BW Reporting for external SQL Server Databases

Farid
Active Participant
0 Kudos

Thanks for the note, the matrix and informations mentionned are extremelly clear

0 Kudos

Hi Beate Grötschnig,

i was trying to connect Ms sql 2000 server from sap bw 7.0 but i got an error when i am using this URL

http://http://192.168.1.99:50300/TestJDBC_Web/TestJDBCPage.jsp in my sap system.

ERROR: Could not connect to database. Connection is inactive or does not support JDBC.

Your inputs will be appreciated

Regards


Hemanth


Former Member
0 Kudos

Dear Beate,

Regarding to Sap Note 1601608 when I execute command  '  odbcinst -i -d -f template.ini '

I am getting the below error.

# odbcinst -i -d -f template.ini

odbcinst: iniOpen failed on template.ini.

Should I give full path for the template.ini where odbcinst.ini file is located like /etc/template.ini

Best regards.

Eren.