Import SAP Data Using Visual Studio
This section provides information on how to use Microsoft Visual Studio to import data from an SAP system into a SQL Server database. This section provides instruction on how to create an SSIS package that you can execute to import data. This section also provides information on how to execute the SSIS package.
Prerequisites
Before performing the procedures provided in this topic, make sure:
Data Provider for SAP is installed on the computer.
Visual Studio 2013 is installed on the computer.
To import data using Visual Studio
Start Visual Studio and create an Integration Service project.
From the Project menu, select SSIS Import and Export Wizard. This starts the SQL Server Import and Export Wizard.
Read the information on the welcome screen and click Next.
In the Choose a Data Source dialog box, from the Data Source drop-down list .NET Framework Data Provider for mySAP Business Suite. The dialog box lists the different connection parameters to connect to an SAP system. A typical connection string to connect to an SAP system using the Data Provider for SAP requires:
The connection parameters for a connection type. The Data Provider for SAP supports connection types A, B, and D. To connect to an SAP system you must provide connection parameters for any one of these connection types. For example, for connection type A, you must provide the name of the application server host and the system number.
The login information to connect to an SAP system such as username and password.
For more information about the connection string to connect to an SAP system using the Data Provider for SAP, see Read about Data Provider for the SAP Connection String.
In the Choose a Data Source dialog box, specify:
The connection parameters for any one connection type.
The login information to connect to an SAP system.
Whether you want to enable SAP GUI debugging.
Whether you want to use RFC SDK tracing.
Click Next.
In the Choose a Destination dialog box:
From the Destination drop-down list, select SQL Native Client.
From the Server name drop-down list, select a SQL server name.
Select an authentication mode.
From the Database drop-down list, select the database to which you want to import the SAP table.
Click Next.
In the Specify Table Copy or Query dialog box, choose the Write a query to specify the data to transfer option and click Next.
In the Provide a Source Query dialog box, specify a SELECT query to filter the data to be imported into the SQL Server. For more information about the grammar for a SELECT query for the Data Provider for SAP, see Syntax for a SELECT Statement in SAP.
Click the Parse button to validate the query and click OK in the pop-up dialog box. Click Next.
In the Select Source Tables and Views dialog box, select the check box against the source and destination tables. The source is the query you specified to retrieve data from SAP. The destination is the table that will be created in the SQL Server database.
The wizard creates a default mapping between the source and destination table fields. However, you can change the mappings according to your requirement. To change the field mappings, click Edit Mappings.
In the Column Mappings dialog box, you can:
Change the names of columns in the destination table.
Ignore certain columns in the destination table.
Change the data type for fields in destination table.
Change other field attributes such as nullable, size, precision, and scale.
Click OK.
In the Select Source Tables and Views dialog box, click Next.
In the Complete the Wizard dialog box, review the summary of actions that the wizard will perform, and click Finish.
In the Performing Operation dialog box, the wizard starts executing tasks to import the information from SAP into a SQL Server database table. The status for each task is displayed in the wizard.
After all the tasks are successfully executed, click Close. If a task fails, see the corresponding error message, fix the issue, and rerun the wizard.
The wizard adds an SSIS package to your Integration Service project. Save the Integration Service project.
Running the SSIS Package
Once the package is created within an Integration Service project, you can execute it to import data from an SAP system into a SQL Server database. Perform the following steps to import SAP data by executing the package.
To run the package from Visual Studio
Navigate to the SSIS package in the Solution Explorer.
Right-click the package name and select Execute Package.
For more information about running packages, see https://go.microsoft.com/fwlink/?LinkId=94972. For any other information related to SSIS packages, see https://go.microsoft.com/fwlink/?LinkId=94973.
Verifying the Results
After executing the package, you must verify the results by logging on to the SQL Server and navigating to the database to which the SAP data is imported. Executing the package should have created a table in destination database and populated with the values from the SAP table.