ABAP Direct-attached third-party database (sqlserver,oracle)

Source: Internet
Author: User

1. Working Environment requirements

A. The operating system user <sid>adm must is able to log on to the secondary database.

B. The R/3 table Dbcon must be maintained.

C. The correct database library ' dboraslib.<ext> ' must exist in the kernel directory.
Connect to SQL Server database Prerequisite:at least one Windows application Server must is available on the R/3 system and the DBSL Dynamic Library (DLL) Dbmssslib.dll must is installed on this server. This DLL can be downloaded from the SAP Service Marketplace.

Dbmssslib.dll

2. Configure connection Information

Configure TCODE:DBCO

Any configuration information is stored in the Dbcon table.

Example configuration:

A. Accessing the MSSQL configuration example (see SAP Notes 178949)

Con_name: <my_conn_name>
Dbms:mss
USER_NAME: <db_user>
PASSWORD: <password>
Con_env:mssql_server=<server_name> mssql_dbname=<db_name>

Db_user could be SAPR3 for example if the server is running R/3. The password field is blocked from view by asterisks in SM30.  User_name can is left blank in order to use integrated security (4.6D kernel and later).  In this case make sure that the OS User running R/3 have the required privilege on the remote server. A dummy Password must be entered in SM30, it won't be used when the user name is blank.
Specifying the server name

The server name is simply the name of the SQL Server or named instance i.e. the hostname (for a default instance), or < Host>/<instname>
Starting with release 6.40 however there is some special considerations that should being taken into account.  When running with kernel release 6.40 or later, the R/3 system would prepend a protocol specifier to the server name. Example:
1. For a server running on the same server:
Np:<servername>
2. For a remote server:
Tcp:<servername>
This forces the connection to is made with a named pipes and TCP/IP protocols respectively.
When specifying the server name can be override this by setting your own protocol (TCP:OR NP:), or you can make R/3 avoi D setting any prefix by using simply:<servername>-a colon in front of the server name.

B. Sample configuration to access Oracle ()

Connection name Logical name of the Connection

DBMS ORA

User Name Oracle Users

DB password password for the above-mentioned Oracle user

Conn.info TNS Alias

Permanent usually should not being set for a secondary connection.



3. How to use the program

Example Cheng
Report Zdbcon.
DATA:DBN (128).
EXEC SQL.
CONNECT to ' DAN1 '
Endexec.
EXEC SQL.
SET CONNECTION ' DAN1 '
Endexec.
EXEC SQL.
SELECT db_name () to:D bn from Svers
Endexec.
Write:/' current database name ', DBN.
DAN1 configuration in the Dbcon table
CON NAME DAN1
DBMS MSS
USER NAME Iis_log
PASSWORD CON ENV
mssql_server=tcp:###.###.###.### Mssql_dbname=iislog


Routine two
Here's an example-to-connect-to-another server with Con_name=bsk. The example assumes BSK is running R/3:

EXEC SQL.
CONNECT to ' BSK '
Endexec.
EXEC SQL.
SET CONNECTION ' BSK '
Endexec.
EXEC SQL.
SELECT db_name () to:D bn from Svers
Endexec.
WRITE:/' Current database name ', DBN.
EXEC SQL.
SET CONNECTION DEFAULT
Endexec.
EXEC SQL.
SELECT db_name () to:D bn from Svers
Endexec.
WRITE:/' Current database name ', DBN.

ABAP Direct-attached third-party database (sqlserver,oracle)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.