Run tests with SAP databases

Tricentis Data Integrity uses the SAP Custom Data Reader to read SAP databases. It's implemented for the Row by Row Comparison and the Load Data into Caching Database from Customization Modules.

Before you start

To run tests with SAP databases, take the following preparatory steps: 

  1. Download the SAP Connector for Microsoft.Net 3.1 for Windows 64bit (opens in a new window), which is not part of the Tosca setup.

  2. Download the ABAP AddOn from our support portal (opens in a new window).

  3. Copy the following files from the SAP .Net Connector to C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\Data Integrity\Custom Data Readers\SAP

    • libicudecnumber.dll (version 7850.212.32.56810)

    • ijwhost.dll (version 8.0.624.26715)

    • rscp4n.dll (version 1.1.1.0)

    • sapnco.dll (version 3.1.1.0)

    • sapnco_utils.dll (version 3.1.1.0)

Required Class Attribute Name

If you want to use SAP Custom Data Reader, you must first define the Class Attribute Name with the value SapReader.

Required parameters

The SAP reader uses the parameters described in the table below. Specify these parameters in your TestStep (Example: Load data from SAP databases into the caching database).

Parameter name

Value

Optional

SystemNumber

The ABAP application server's instance number.

This can be a value from 0-99.

No

ApplicationServer

The service name, as defined in etc/services, or the port number under which the application server's gateway process is listening for RFC requests. This is the DNS name or IP-Address.

Example: sap-server.acme.com

No

Client

The Client ID used to log into the SAP system.

Example: 200

No

Language

The language you use to log into the SAP system.

Example: EN

No

Username

The user name you log into the system with.

No

Password

The password for the specific user.

No

Tablename

The name of the SAP table to read data from. Please note that the table names are case-sensitive.

No

DataProvisioningTimeout

You can set a timeout in seconds, until the SAP system sends data. The default value is 300 seconds (5 minutes). You only need this parameter if your SAP system takes more than 5 minutes to deliver data.

Yes

RowFilters

You can set parameters to fetch data with specified filters from an SAP table following this syntax: F[],O[],L[],H[],S[]

Use the following mandatory parameter values:

  • F = Field name

  • O = Operator

  • L = Low value

  • H = High value is needed if you use the operator BT in between

  • S = Select I for include or E for exclude

For operators that require a low value, use the following parameters:

  • EQ = Equal

  • NE = Not equal

  • LT = Less than

  • LE = Less than or equal to

  • GT = Greater than

  • GE = Greater than or equal to

  • CP = Contains pattern, such as Sm*th can be Smyth or Smith, but no regular expressions

For operators that require a high and low value, use the following parameter:

  • BT = Between

Example

The following examples show how processes parameters and operators:

  • The syntax F[Firstname],O[EQ],L[Anna],S[I] looks in the column Firstname for a value that is equal to Anna and includes it.

  • The syntax F[Age],O[BT],L[20],H[50],S[I] first looks in the column Age and includes all values between 20 and 50.

Use a semicolon to set multiple row filters:

F[Firstname],O[EQ],L[Anna],S[I];F[Age],O[BT],L[20],H[50],S[I];...

To combine multiple row filters with OR, use the same values for the parameter F, such as: F[Firstname],O[EQ],L[Anna],S[I];F[Firstname],O[EQ],L[Julia],S[I].

To combine multiple row filters with AND, use

  • different values for the parameter F, such as: F[Age],O[BT],L[20],H[50],S[I];F[Weight],O[BT],L[150],H[185],S[I],

  • or different values for the parameter S, such as: F[Age],O[BT],L[20],H[50],S[I];F[Age],O[BT],L[20],H[50],S[E].

Yes

ColumnFilters

You can set this parameter to specify which columns of an SAP table you want to be returned.

Use the following mandatory parameter value:

F = Field name

Use a semicolon to set multiple column filters:

F[Firstname];F[Lastname];F[Country];...

Examples

The following examples show how to select specific columns from an SAP table:

  • The syntax F[Firstname] returns data for the column Firstname.

  • The syntax F[Firstname];F[Lastname] returns all rows for the columns Firstname and Lastname.

Yes

Example: Load data from SAP databases into the caching database

In this example, you're loading data from a SAP database into the caching database.

To do so, perform the following steps:

  1. To integrate your Custom Data Reader, you copy and paste the four DLL files from the SAP .Net Connector into the Custom Data Readers folder located at C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\Data Integrity\Custom Data Readers\SAP.

  2. In Tosca, you open the Load Data into Caching Database from Customization TestStep.

  3. As Table Name, you specify the name of the table Tosca DI loads the data into.

  4. In the Value field of Class Attribute Name, you define SapReader.

  5. Create your Parameters with the following values:

    • SystemNumber: the ABAP application server's instance number with the value 00.

    • ApplicationServer: the service name with the value sap-server.acme.com.

    • Client: the Client ID with the value 200.

    • Language: your specified SAP system language with the value EN.

    • Username your SAP system username with the value MyUserName.

    • Password your SAP system password.

    • Tablename the name of the SAP table to read from with the value SAP_table.

    • DataProvisioningTimeout: the seconds you wait to get data from SAP with the value 360.

    • RowFilters: the value John in the column Firstname.

    • ColumnFilters: the values Firstname and Lastname to return the corresponding columns.

Load data from an Sap database into the caching database