512739 - BW External DB Connect for MS SQLServer

3
SAP Note Header Data Symptom You can use DB Connect to establish a connection to an external SQL Server system and use it as a source system to SAP BW. The enhancement that DB Connect makes to the database interface enables you to transfer data from external applications in the respective database tables or views directly into the BW system. This functionality has been available since SAP BW release level 3.0B or higher. The following note describes: what prerequisites apply; what problems may occur; which of these problems can be solved. The following notes describe other use cases for external database connections to SQL Server: l 1458291 - to use Solution Manager 7.1 l 1388700 - to use Solution Manager 7.0 EHP1 l 178949 - to set up a DBCON to programmatically access remote databases l 1316740 - to use DBACockpit alone Other Terms Rsdbc, DATES, TIMES, DBCON, DBCONNECT, Source System Database, Datasource, Infosource Reason and Prerequisites This Note is structured in the following way: 1. Limitations 2. Obtaining and Installing the required software 3. Possible problem areas The actions are described in detail in the following sections. Solution 1. Limitations The work involved in configuring an external SQL Server as a BW source system is in the area of consulting and not in the area of support. The process is detailed for each SAP BW release in the SAP Help Portal at http://help.sap.com. To implement this type of connection, you require know-how and experience in the use of the source database (in this case, the SQL Server) and the tools and DB specific functions required. Knowledge of the source application is also essential to ensure that semantically relevant data reaches the BW system. 2. Obtaining and Installing the required software The following section only applies when your SAP BW system is installed on a different database system than Microsoft SQL Server. To create a connection from the SAP BW system to a server, you require the SAP Basis software ("kernel") and two other database system-specific software components. These are the Database Shared Library (DBSL) from SAP and the Microsoft SQL Server SNAC client library. If the SAP application server is running on the Windows operating system, see SAP Note 1774329 for instructions on downloading and installing both the SAP DBSL and Microsoft SNAC. 512739 - BW external DB Connect for MS SQLServer Version 12 Validity: 25.10.2012 - active Language English (Master) Released On 25.10.2012 15:32:31 Release Status Released for Customer Component BW-SYS-DB-MSS BW Microsoft SQL Server BW-WHM-DST-DBC DB Connect Priority Correction with high priority Category Consulting Other Components

description

512739 - BW External DB Connect for MS

Transcript of 512739 - BW External DB Connect for MS SQLServer

Page 1: 512739 - BW External DB Connect for MS SQLServer

SAP Note

Header Data

Symptom

You can use DB Connect to establish a connection to an external SQL Server system and use it as a source system to SAP BW. The enhancement that DB Connect makes to the database interface enables you to transfer data from external applications in the respective database tables or views directly into the BW system. This functionality has been available since SAP BW release level 3.0B or higher. The following note describes: what prerequisites apply; what problems may occur; which of these problems can be solved. The following notes describe other use cases for external database connections to SQL Server:

l   1458291 - to use Solution Manager 7.1

l   1388700 - to use Solution Manager 7.0 EHP1

l   178949  - to set up a DBCON to programmatically access remote             databases

l   1316740 - to use DBACockpit alone

Other Terms

Rsdbc, DATES, TIMES, DBCON, DBCONNECT, Source System Database, Datasource, Infosource

Reason and Prerequisites

This Note is structured in the following way:

1. Limitations

2. Obtaining and Installing the required software

3. Possible problem areas

The actions are described in detail in the following sections.

Solution

1. Limitations The work involved in configuring an external SQL Server as a BW source system is in the area of consulting and not in the area of support. The process is detailed for each SAP BW release in the SAP Help Portal at http://help.sap.com. To implement this type of connection, you require know-how and experience in the use of the source database (in this case, the SQL Server) and the tools and DB specific functions required. Knowledge of the source application is also essential to ensure that semantically relevant data reaches the BW system.

2. Obtaining and Installing the required software The following section only applies when your SAP BW system is installed on a different database system than Microsoft SQL Server. To create a connection from the SAP BW system to a server, you require the SAP Basis software ("kernel") and two other database system-specific software components.  These are the Database Shared Library (DBSL) from SAP and the Microsoft SQL Server SNAC client library. If the SAP application server is running on the Windows operating system, see SAP Note 1774329 for instructions on downloading and installing both the SAP DBSL and Microsoft SNAC.

    512739 - BW external DB Connect for MS SQLServer  

Version   12     Validity: 25.10.2012 - active   Language   English (Master)

Released On 25.10.2012 15:32:31

Release Status Released for Customer

Component BW-SYS-DB-MSS BW Microsoft SQL Server

BW-WHM-DST-DBC DB Connect

Priority Correction with high priority

Category Consulting

Other Components

Page 2: 512739 - BW External DB Connect for MS SQLServer

If the SAP application server is running on a Linux operating system, see SAP Note 1644499 for instructions on downloading and installing both the SAP DBSL and Microsoft SNAC.

3. Possible problem areas

a) Datetime data type in source system tables The Datetime DB data type and similar (timestamp, smalldatetime) are not used in SAP installations. This type of data cannot be transferred consistently into the BW system without additional activities. Solution: You must create a view in the source system to transform the data. Since a field of the type DateTime actually represents two SAP Basis types (DATES, TIMES), you must split it into a maximum of two fields, as appropriate:   create view <VIEWNAME> as   select   VD_1_D = convert(varchar(4), datepart(yyyy, d_1))          + case len(convert(varchar(2), datepart(mm, d_1)))               when 1 then '0' + convert(varchar(1), datepart(mm, d_1))               else convert(varchar(2), datepart(mm, d_1))               end          + case len(convert(varchar(2), datepart(dd, d_1)))               when 1 then '0' + convert(varchar(1), datepart(dd, d_1))               else convert(varchar(2), datepart(dd, d_1))               end,   VT_1_T =  case len(convert(varchar(2), datepart(hh, t_1)))               when 1 then       /* Hour Part of TIMES */                     case convert(varchar(2), datepart(hh, t_1))                       when '0' then '24'    /* Map 00 to 24 ( TIMES ) */                       else '0' + convert(varchar(1), datepart(hh, t_1))                     end               else convert(varchar(2), datepart(hh, t_1))               end          + case len(convert(varchar(2), datepart(mi, t_1)))               when 1 then '0' + convert(varchar(1), datepart(mi, t_1))               else convert(varchar(2), datepart(mi, t_1))               end         + case len(convert(varchar(2), datepart(ss, t_1)))               when 1 then '0' + convert(varchar(1), datepart(ss, t_1))               else convert(varchar(2), datepart(ss, t_1))               end   from <TABLENAME> The t_1 Basis field in the table is converted into a DATES field VT_1_D      and a TIMES field VT_1_T. During the generation of the VT_1_T field, the value for 00:00 hours is also converted to 24:00 hours. This conversion may be omitted if not required.

b) Float data type in source system tables In accordance with the IEEE standard regulations, MS SQL Server supports a value range of 1x10E-307 to +go- 1x10E+308. This also applies to the corresponding ABAP data type. However, the BW database in question may restrict this. Depending on the system, a restriction to 1x10E-25 is possible.

c) Nvarchar data type in source system tables The length information displayed is twice as big as the number of characters you specified when you created the column.

d) Writing names in the source system Since the R/3 kernel used in BW can only process table and column names written in upper case, on the source system, you must create DB views that convert the original names in accordance with this rule.

e) Code page and sort sequence of the source system R/3 kernel-based systems such as BW basically assume that the database being used was created using code page cp850 and with the sort sequence 'bin2'. The configuration of the source system may differ. If the sort sequence is different, operations for string search (like) and area search (between, >, <) on character fields may return different results. Solution:  There is currently no solution. If you use multibyte code pages in the source system to save data with character sets of more than 256 characters (Kanji, Hiragana, Korean, Chinese and so on), the characters may be corrupted as a result. Solution:  There is currently no solution.

f) Authorizations and visible objects BW DB Connect uses a remote server as a source system to extract data. The data already exists in that remote system. To use BW DB Connect, you will create a new login and new views which the SAP BW system will use when connecting. You must remember only the DB objects (tables and views), which directly belong to the new database login are visible. You cannot use a login that belongs to the Sysadmin server role, (for example 'sa').

Page 3: 512739 - BW External DB Connect for MS SQLServer

To create the new login and views: 1. Create a new login and map it to a user in the database with membership in db_ddladmin 2. Grant the new user (SELECT at least) access to the original data tables. 3. Login as this new login and create the views in the database/schema of that user, referring to the original (source) data tables. 4. Specify this new login in the data extraction and this login/user will read from his own views in his own schema. 5. Optionally you can switch the new user's role to db_datareader which is sufficient for reading data. Further changes to the remote system e.g. new views or changed views will require the db_ddladmin role again.

Other Attributes

Validity

References

This document refers to:

SAP Notes

This document is referenced by:

SAP Notes (3)

HIER

KEIT

Software Component From Rel. To Rel. And Subsequent

SAP_BW 30A 30B  

1396552   Remote connection delivers wrong character data

541954   Erweiterung von CL_SQL_METADATA_MSS

178949   MSSQL: Database MultiConnect

178949   MSSQL: Database MultiConnect

1396552   Remote connection delivers wrong character data

541954   Erweiterung von CL_SQL_METADATA_MSS

Transaction codes