Accessing SAP Data with ImpactECS

SAP Connections are items that allow Queries and Script Modules to access data that resides in SAP. They are used in conjunction with SAP Adapters to invoke BAPIs on specific SAP systems. This allows developers to customize their solutions to work in both an automated or an on-demand fashion. The following instructions describe how to get started using SAP Connections.

Creating a new SAP Connection

Perform the following steps to create a new SAP Connection:

1. Log on to an ImpactECS Server using the Desktop Client.

2. Select the SAP Connections item in the Folders Panel, right click it and select New SAP Connection from the context menu.

3. Supply the appropriate information in the SAP Connection Properties dialog box and select OK to create the new SAP Connection.

SAPConnection

Accessing SAP data using Queries

In addition to executing SQL statements against databases or OLEDB Providers, Queries also allow model builders to execute BAPI functions against SAP systems. This is best illustrated by walking through a simple example. Perform the following steps to retrieve a list of general ledger accounts for a given company code.

1. Open an ImpactECS Model and create a new Query named “GL Accounts”.

2. With the Query open, click on the Settings tab and set the Connection Name value to a valid SAP Connection (see above); then set the Maximum Records value to 0.

3. Next, click on the Query’s Text tab and enter the following statement:

SAPGetBAPI

4. Save and execute the Query.  This will prompt you to enter the COMPANYCODE Query parameter.

5. Enter a valid company code (for example: 1000) and select OK to view the general ledger accounts associated with this company.

SAPQuery

Accessing SAP data using Script Modules

Script Modules support two distinct options for accessing data that resides in SAP. The first option is to programmatically execute a Query that references a BAPI function (see above). The second option is to utilize the SAPAdapter’s CreateBAPIFunction method. The following Script Modules demonstrate how to implement these options.

Example 1: Accessing SAP using a Query object

SAPQueryObject

Example 2: Accessing SAP Using the CreateBAPIFunction method

SAPCreateBAPI

 

Comments