Skip to main content
Close announcements banner

Using the SAP BAPI Connector

The BAPI Connector enables calls to Function Modules or BAPIs (Business Application Programming Interface) in an SAP BASIS System 7.00, and later. The QA method of a BAPI is implemented as a Function module.

Information note

This SAP connector is available in:

  • Qlik Sense Enterprise on Windows

  • QlikView

Creating a connection

Do the following:

  1. Open a new or existing Qlik Sense or QlikView app.
  2. Select SAP BAPI from the list of connectors.

    A create connection dialog opens, like the following from the QlikView Edit script dialog.

    SAP connection dialogue image

    Connection fields available to be configured
    Connection field Description
    Server Type Application Server or Message Server
    Information noteDo not change the Server Type once you start to edit the remaining fields as a connection error may result. If this is the case close the Connect… dialog and restart the script editor.
    Host Address of the Application Server or Message Server.
    Client The client number of the SAP system.
    System Nr The system number of the SAP Application Server system.
    System ID / Port The system ID of the SAP Message Server system.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.You can also enter the Port number directly, instead of the System ID. The Port number is of the form 36nn where nn is the system number.
    Group The Message Server group
    Username

    A user name authorized to access the SAP system.

    Information noteRemember that different users can get different results due to row based access control.

    Access control

    Password The authorized user's password.
    DataTypeLegacy

    Determines whether the connector delivers values in the same format as the legacy connector.

    Secure Network Settings

    Select Secure Network Connection if Secure Network Communication is installed.

    Secure network communication

    BAPI search language

    A BAPI is created with language code. To be able to look up a BAPI, the correct language code must be entered. If no language code is entered, the connector uses the following priority to decide which language to use:

    1. SAP user default logon language, if set.
    2. System language
    3. If no system language can be found, then English.

    To look up BAPIs in all available language codes, enter "ALL" as the language. When "ALL" is specified, the list of BAPIs shows a one-letter language code.

    The language functionality is only valid for the look-up function. It is always possible to enter the full name of a BAPI in any language directly in the connection dialog, without using the look-up functionality.

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

Defining a query in QlikView

Do the following:

  1. In the Script Editor, click BAPI to select a function.

    Script editor Data tab

  2. In the BAPI select dialog, enter the name of the BAPI function found in the SAP system.

    BAPI select dialog

    You can select Search for BAPIs to get a list of all available BAPI functions. The search dialog also allows you to filter the list of BAPIs.

    Search for BAPI example output

  3. After entering a BAPI function, click Get parameters.
  4. Select the parameters needed to run the function.

    Get parameters example output
  5. Some Functions return more than one table, but QlikView can only handle one for each statement. Select the output table you want and then click Add call to script.

    Output table selection example

Defining a query in Qlik Sense

  1. Choose a BAPI from the drop-down list of available BAPIs.

    You can use BAPI Filter to search for BAPIs within the list. The asterisk (*) can be used as a wildcard character. The filter compares the BAPI name and the description. The description is the text that appears in parentheses after the name. For example: .

  2. On the next screen, select the output from the BAPI.

    BAPI output selection

  3. On the next screen, enter the Select input parameters needed to run the function selected.

    Select input contains multiple lines. Each line represents one row of input data. Input fields marked with a red asterisk (*) are required. The purpose of each input is indicated below the field. The data type and character limit for each field is also indicated.

    Select input dialog

  4. Select Add data.

    If you are using the Data load editor, move to the next screen to preview the script generated from your selections. Then you can select Insert script.

At this point, you can review the tables that have been added to the Data manager and then select Load data. In the Data load editor, you can immediately select Load data after the script has been inserted in the script editor.