Skip to Content

SAP BW 7.3: How to extract data from SQL Server using DB Connect

In this document (my first one) I will comment how to create a connection from SAP BW to SQL Server step by step and the small problems that I encountered during the process. I hope it can help to someone who has to perform this process in the future.

Step 1. Create the Source System.

RSA1 –> Source Systems –> Right click on “DB Connect” –> Create…

/wp-content/uploads/2013/11/1_325025.jpg

Step 2. We need to fill the next fields:

Logical System Name: in our case we have named “MSSQLS”.

Source System Name: Text field (40 Characters Long).

Type and release: here we can specify a type and a release of this source system.

/wp-content/uploads/2013/11/2_325026.jpg

Step 3. Once named the system we have to create the connection parameters:

DB Connection: the logical name with which we have created our connection.

DBMS: the database type to which you want to connect. In this case “MSS”. There are the following ones:

/wp-content/uploads/2013/11/3_325027.jpg

User Name and DB Password: user and password with which we are going to connect to the database.

Conn. Info: specific information for database connection. In our case:

MSSQL_SERVER=SERVERNAME1 MSSQL_DBNAME=DBNAME1 OBJECT_SOURCE=SAP

With:

MSSQL_SERVER: name of the server we are going to connect.

MSSQL_DBNAME: name of the database from which we will extract data.

OBJECT_SOURCE: name of the schema in which the tables are available.

Permanent: related to what happens when an open database connection is lost due to a database failure or lost network connection.

Connection Limit: Maximum Number of DB Connections

Optimum Conns: Optimal number of DB Connections

/wp-content/uploads/2013/11/4_325031.jpg

Step 4. In SQL Server the user must have the following permissions:

/wp-content/uploads/2013/11/5_325032.jpg

Step 5. We check that the connection is correct.

/wp-content/uploads/2013/11/6_325033.jpg

/wp-content/uploads/2013/11/7_325034.jpg

Step 6. We select the tables or views from which we want to extract the information.

Right-click –> Additional Functions –> Select Database Tables (3.x)

/wp-content/uploads/2013/11/8_325035.jpg

Then we press “Execute”:

/wp-content/uploads/2013/11/9_325036.jpg

The following tables and views have been found:

/wp-content/uploads/2013/11/10_325037.jpg

… the same views we wanted to access:

/wp-content/uploads/2013/11/11_325038.jpg

Important note: as seen in the image below, we cannot access “View_2” because the names of the tables/views (and their fields) must be in UPPERCASE.

/wp-content/uploads/2013/11/12_325039.jpg

Step 7. If we select any of the first four tables and we press “Edit DataSource” we can see the fields (Field Name, Database Type, Length in Database …) of each table:

/wp-content/uploads/2013/11/13_325040.jpg

Step 8. If we press “Display Table Contents” /wp-content/uploads/2013/11/14_325041.jpg  we can see the content:

/wp-content/uploads/2013/11/15_325042.jpg

Step 9. If we press “Check DataSource” /wp-content/uploads/2013/11/16_325043.jpg  we can verify the DataSource. In this case displays a warning because the length of one of the fields is larger than 16:

/wp-content/uploads/2013/11/17_325044.jpg

Step 10. And if we press “Generate DataSource” /wp-content/uploads/2013/11/18_325045.jpg  we create the DataSource in BW side.

/wp-content/uploads/2013/11/19_325046.jpg

A message shows that the DataSource (6DB_tablename) has been successfully generated:

/wp-content/uploads/2013/11/20_325047.jpg

Step 11. If we return to the Workbench we can see that our DataSource has been generated (in version 3.x):

/wp-content/uploads/2013/11/21_325048.jpg

Step 12. Click the right mouse button and migrate the DataSource to version 7.0.

Step 13. Create the transformation rules (as we can see below):

/wp-content/uploads/2013/11/22_325049.jpg

Step 14. Create the Infopackage and DTP.

Step 15. Execute the Infopackage and DTP and we can see that our Infoobject (ZCCAA2) has been loaded correctly:

/wp-content/uploads/2013/11/24_325050.jpg

Best regards,

Carlos

44 Comments
You must be Logged on to comment or reply to a post.