Skip to main content
Close announcements banner
Using the SAP Query Connector

ON THIS PAGE

Using the SAP Query Connector

The SAP Query Connector works with QlikView. It is strongly recommended to test the query in transaction SQ01 prior to testing it with QlikView. If the query prompts for variable input, create a variant of the query with pre-defined values for the variables.

Information noteThis SAP connector is only available in QlikView.

Establishing a connection

Do the following:

  1. Start QlikView.
  2. Open the Script Editor.
  3. Select the Data tab, and then select the QvSAPQueryConnector.dll option from the drop down list.

    Data tab with QvSAPQueryConnector.dll selected

  4. Click Connect....
  5. SAP connection dialogue image

  6. Enter the Application Server Host address, Client, and System Number of the target SAP system, or select the Message Server Host option and enter the Message Server Address, Client, System ID, and Group.

    If passing through a message server, an entry may have to be added in the C:\WINDOWS\system32\drivers\etc\services file. Add sapmsxxx 36nn/tcp, where xxx is the system ID and nn is the system number. If it is the last line in the file, add a new line break after the entry.If passing through an SAP router, paste the router string in the Application Server Host/Message Server Host address field.
  7. Enter the Username and Password of the user that is to be used for this specific download.

  8. Click Test Connection to verify that all fields are correctly filled in.
  9. Finally, click OK to get a connection string in the script.

Passing through a SAP Router

Do the following:

  1. When you are creating the connection, go to the Application Server Host/Message Server Host field.

  2. Input the following string: /H/<Host name or IP number of SAP Router>/S/3299/H/<Fully Qualified Domain Name of target system>

    The port which the SAP Router is listening to is always 3299.

  3. (Optional) Fill in the following connection string properties: SAPRouter, GatewayHost, and GatewayService. These are described below under "Connection string properties".

    This step is not mandatory, but is useful if the connection needs to be made through a firewall via SAP router.

  4. If passing through a Message server, please read that section below. Note that the services file must also be updated on the SAP Router server. In that case, the SAP Router needs to be restarted.

Passing through a Message server

If passing through a Message server, you may need an entry for the Message server port in the services file.

Do the following:

  1. Locate the services file in: C:\Windows\System32\drivers\etc

  2. Add sapmsxxx 36nn/tcp, where:

    1. xxx is the system ID

    2. nn is the system number (of the Message server).

    If it is the last line in the file, add a new line break after the entry.

There is an alternative to updating the services file. When you create the connector connection, you can enter the Message server port number directly, instead of the System ID.

The port number is of the form 36nn, where nn is the system number.

Connection string properties

There are a number of properties that can be added to the connection string, if needed. Normally, the default values for the properties are sufficient. Separate properties with ; (semi colon) in the connection string:

  • ENotationLegacy=0/1(default/off = 0, on = 1): When the property is turned on, fields of the type CHAR that contain a value that can be interpreted as a Scientific Notation Number are converted to a number in QlikView. When the property is turned off, all values that can be interpreted as a Scientific Notation Number are handed as text values.

    A value that can be interpreted as a Scientific Notation Number consists of numbers and the letter E, where E appears within the string of numbers. For example, 2E2, 0E123456, 1e2349.

  • Logpath=xxxx: Places log files in a subfolder named xxxx. The folder is created, if needed. xxxx can be any text string that can be a valid part of a folder name in Windows.

  • LogFile=yyyy: Names the log file yyyydatetime-n.txt. yyyy can be any text string that can be a valid part of a filename in Windows.

  • SAPRouter: Use this field to specify the SAPRouter parameters if the connection needs to be made through a firewall via a SAP Router. Possible value is a string of host name and service name/ port in the following format: /H/hostname/S/portnumber

  • GatewayHost: The hostname of the Gateway at which you want to register. It must be the same as defined in SAP transaction SM59 (if the RFC destination defines an explicit gateway).

  • GatewayService: The Service name (as defined in etc/services) or the port number under which the gateway is listening. Possible values are: sapgw00 - sapgw99, 3300 - 3399

Select data to load

Do the following:

  1. Click Queries in the Script Editor.

    Data tab with QvSAPQueryConnector.dll selected

  2. Enter the search criteria for the User Groups in the Search for field, or select the required groups by checking the boxes next to the group names. The checkbox Name can be used to select or deselect all groups. The button Clear selections can be used to deselect all groups.

    QvSAPQueryConnector Select User Groups dialog

  3. Click OK.
  4. Enter the search criteria (query name and/or query description) in the Search for field.

    SAP Query selection dialog

  5. Select a query and click Preview or Add to Script. To go back to the previous window to select a different group, click the Select User Groups button.

  6. It is also possible to choose the Select Options button to create a variant.

    SAP Queries Select Options dialog

  7. Click OK to return to the Script Editor with the generated script.