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

ABAP(unix) connection to sql server

Former Member
0 Likes
801

Hi expert,

i'm trying to connect my sap system(in UNIX platform) to a sql server.

I tried to do this by ODBC connection with dbmssslib.dll in a sap system on windows and it works.

The customer have a sap system on UNIX, so the connection by ODBC doesn't work, i would like to connect it using abap statement(JDBC getconnection).

Someone can help me?

thanks in advance.

ciao

Hi expert,

i'm trying to connect my sap system(in UNIX platform) to a sql server.

I tried to do this by ODBC connection with dbmssslib.dll in a sap system on windows and it works.

The customer have a sap system on UNIX, so the connection by ODBC doesn't work, i would like to connect it using abap statement(JDBC getconnection).

Someone can help me?

thanks in advance.

ciao

4 REPLIES 4
Read only

sarbajitm
Contributor
0 Likes
728

Hi,

Put your Query on Database and OS Platform instead of ABAP Development, I think you get some positive reply by that.

Thanks.

Edited by: Sarbajit Majumdar on Jul 29, 2009 6:50 PM

Edited by: Sarbajit Majumdar on Jul 29, 2009 6:50 PM

Read only

Former Member
0 Likes
728

Hi,

i need to get the query data in SAP system, for example in a Function Module.

Regards.

Claudio.

Read only

0 Likes
728

My suggestion is like this:

1. Have your basis team create a connection to the sql server. They do it with transaction DBCO.

2. In your ABAP program you need to use native SQL to connect to the database and select data. For example the code below works for an external Oracle database.


DATA: conn like dbcon-con_name.
conn = 'SRV001'.
    EXEC SQL.
      connect to :conn
    ENDEXEC.
    EXEC SQL.
      set connection :conn
    ENDEXEC.

  EXEC SQL.
    OPEN C FOR
      SELECT * from TBLA
      WHERE ....
  ENDEXEC.

  DO.
    EXEC SQL.
      FETCH NEXT C INTO :wa
    ENDEXEC.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    APPEND wa TO itbl.
  ENDDO.
  EXEC SQL.
    CLOSE C
  ENDEXEC.

Cheers, Gabriel

Read only

Former Member
0 Likes
728

Hi Gabriel,

i have a system on Unix so i think to miss any libraries for use a DBCO connection.

this is the errore if i try your suggestion:

As well as the standard connection, an attempt was made to set up

another database connection, under the specified ID. The Shared Library

for this second database could not be found.

The Shared Library is usually found in the the Executable

directory (profile parameter DIR_LIBRARY) under the name dbs

<dbs>slib<os_ext>. <dbs> stands for the database type and <os_ext>

stands for the operating system-specific extension of the Shared

Libraries.

The database type is determined from the entry that corresponds to the

specified DB ID in the table DBDCON. Check whether the data in this

entry is correct.

do you have an idea how can i connect by JDBC ?

thanks a lot.

Claudio