---
title: Management Systems - SAP BAPI
description: Create and configure connectors in the old canvas
documentId: ipaas-legacy-connectors-erp
locale: en-US
---

* **SAP BAPI**

## Overview

The **SAP BAPI** connector allows you to integrate your flow with the SAP ERP through _Business Application Programming Interfaces (BAPIs)_, which are standardized functions to access business processes and data in the SAP system.

In other words, a BAPI is like an "official gateway" that SAP provides so that external systems can query or manipulate data and processes without needing to directly access internal tables or write ABAP code.

## What you can do

- **Query data**

  - Retrieve information about customers, vendors, materials, sales orders, inventory, etc.

    Example: `BAPI_CUSTOMER_GETDETAIL` returns complete customer data.

- **Create records**

  - Insert new business data into SAP.

    Example: `BAPI_SALESORDER_CREATEFROMDAT2` creates a sales order.

- **Update records**

  - Modify existing data.

    Example: `BAPI_EMPLOYEE_CHANGE` updates employee data.

- **Execute business operations**

  - Trigger internal SAP processes (release documents, perform calculations, generate accounting entries).

    Example: `BAPI_GOODSMVT_CREATE` records an inventory movement.

- **Test connection and availability**

  - Validate if SAP is responding.

    Example: `STFC_CONNECTION` (returns system information, client, user, etc.).

## Instruction structure (syntax)

Communication with this connector uses a specific key-value structure to map BAPI parameters.

- **Command**: always starts with `CALL FUNCTION <BAPI_NAME>`.
- **Parameters**: are defined after the colon ":".
- **Groupings**:
    - **Parentheses ( )**: enclose a single key-value pair or an object.
    - **Brackets [ ]**: enclose lists of items or multiple parameters.

- **Syntax:**

```
CALL FUNCTION BAPI_NAME: [ (PARAMETER_1: VALUE), (TABLE: [ (FIELD: VALUE) ]) ]
```

## Examples

Check out examples of instructions for the SAP BAPI connector:

### Connectivity validation

**Instruction:**

In the instruction below, the SAP BAPI connector calls the `STFC_CONNECTION` function in SAP. This function is a standard SAP BAPI, used to test connectivity between the client system (in this case, Sensedia Integrations) and the SAP server.

```
CALL FUNCTION STFC_CONNECTION: []
```

<Callout type="note" title="NOTE">
The brackets [] indicate that no additional parameters were passed in the call.
</Callout>

**Return (log):**

- The log excerpt shows the successful execution of the SAP BAPI connector when calling the `STFC_CONNECTION` test function.
- SAP responded to the request confirming the connection with information about system, _client_, user, and date/time.
- HTTP status 200 ensures there was no integration error.

```json
{
"message": {

     "payload": "{\"STFC_CONNECTION\":{\"INPUT\":{\"REQUTEXT\":\"\"},\"OUTPUT\":{\"ECHOTEXT\":\"\",\"RESPTEXT\":\"SAP R/3 Rel. 740   Sysid: ERQ      Date: 20250912   Time: 130104   Logon_Data: 300/APISENSEDIA/E\"}}}",

     "status": 200 }
}
```
<Callout type="note" title="NOTE">
Read about [log details](/doc/integrations/ipaas-logs).
</Callout>

### Table reading

**Instruction:**

The instruction below reads the first 5 rows of table T001 in SAP, returning only the BUKRS and BUTXT fields, separated by semicolons.

```
CALL FUNCTION RFC_READ_TABLE: [
    (IMPORTING: [
        (QUERY_TABLE: T001),
        (DELIMITER: ;),
        (ROWCOUNT: 5)
    ]),
    (TABLES: [
        (FIELDS: [
            (FIELDNAME: BUKRS),
            (FIELDNAME: BUTXT)
        ])
    ])
]
```

**Instruction parts:**

- **FUNCTION RFC_READ_TABLE**: defines that the table reading function will be executed.
- **IMPORTING**: contains simple input parameters that configure the function call.
    - `QUERY_TABLE: T001`: indicates the table to be queried (T001, which contains Company Codes information).
    - `DELIMITER: ;`: defines that returned fields will be separated by semicolons.
    - `ROWCOUNT: 5`: limits the return to the first 5 rows of the table.
- **TABLES**: defines parameters in table format, used to send or receive lists of records.
    - `FIELDS`: specifies the table fields that should be returned (if omitted, returns all columns, which may cause slowness or memory overflow).
        - `BUKRS`: company code (Company Code).
        - `BUTXT`: company description (Company Name).

**Return (log):**

Check two excerpts of the response _payload_ recorded in the _logs_:

**INPUT**: shows the query parameters: queried table, maximum number of records, delimiter, and additional options.

```json
{"INPUT":{"QUERY_TABLE":"T001","ROWCOUNT":5,"GET_SORTED":"","NO_DATA":"","USE_ET_DATA_4_RETURN":"","ROWSKIPS":0,"DELIMITER":";"}}
```

**DATA** (excerpt): brings the values returned from the query.

```json
DATA":{"item":[{"WA":"300;0001;SAP Brazil ;Sao Paolo ;BR ;BRL ;P;INT ;10;K4;2;000001; ; ; ; ; ; ; ;00000000;2; ; ; ; ;0001; ; ; ;X; ; ; ; ; ; ; ; ; ; ; ;0001; ;0001;0001; ; ;0001; ; ; ; ; ;IE;SE;1; ;X;X; ; ;FMRE; ; ;0; ; ; ; ; ; ; ; ; ; ; ; ; ; ;"}
```

In this example:

- The WA (Work Area) field brings the data concatenated by the chosen delimiter
- 300: MANDT (SAP Client)
- 0001: BUKRS (Company Code)
- SAP Brazil: BUTXT (Company Name)
- Sao Paolo: ORT01 (City)
- BR: LAND1 (Country)
- BRL: WAERS (Currency)

## Possible configuration errors

Below we list some common errors that may occur when using the SAP BAPI connector and recommended solutions.

- **Error calling BAPI function in SAP**

  Generic execution error.

  - Check if the configured user has access permission (object `S_TABU_DIS`) to the requested table or execution permission in the BAPI.
  - Check if the field names in `FIELDS` exist in the table.

- **Empty return (DATA: [])**

  No record matches the criteria defined in `OPTIONS`.

  - Check if the date is in YYYYMMDD format.
  - Check if the values are in uppercase, as SAP is case-sensitive for data.

- **ROWCOUNT ignored**

  SAP returned more rows than requested.

  <Callout type="note" title="NOTE">
  This occurs in certain versions of the function module when there is no primary index in the filter.
  </Callout>
  
  - Apply a script or filter component in your flow to eliminate excess rows.


## Creating and editing a connector

To create a connector, follow the steps below:

<Steps>
<Step>
Access the **Connector Manager** screen from the left menu of the product or by clicking the card on the Welcome screen.
</Step>
<Step>
Click **+ NEW CONNECTOR** in the upper right corner of the screen.
</Step>
<Step>
Select the connector card. 

A new screen, **Connector Configuration**, will open.
Fill in the following data in the connector form:
</Step>
<Step>
In **Name**, give the connector a name.
</Step>
<Step>
In **Version**, enter its version.
</Step>
<Step>
In **Description** *(optional)*, add a description.
</Step>
<Step>
Select the environment in which you will deploy the connector.
</Step>
<Step>
Fill in the values for the [required fields](#required-fields) for each connector.
</Step>
<Step>
Click **CREATE**.
</Step>
</Steps>

<Callout type="note" title="NOTE">
If you select both environments, you must fill in the complete data for both to be able to create the connector.
</Callout>

To edit the connector, follow the steps below:

<Steps>
<Step>
Click on the connector you want to edit. 

You can change:

* The description in the **Description** field.
* The environment selected for deployment: _staging_ or _production_ (there must be at least one environment enabled).
* The information in the selected environment form, even if the connector is in use in any integration flow.
</Step>
<Step>
When you finish your edits, click **SAVE**.
</Step>
</Steps>

<Callout type="warning" title="IMPORTANT">
You **cannot** delete a connector while it is in use in any integration.
</Callout>

## Required fields


| Field | Description |
|-------|-----------|
| SAP Application Server | The hostname or IP address of the SAP application server you want to connect to. |
| Service Name of the Gateway | The service name identifies the specific service or port on the SAP gateway through which communication will occur. |
| Logon Password | This is the password associated with the SAP user specified in the "Logon User" field. It is required for authentication purposes to establish a connection to the SAP system. |
| SAP Client | The client number you want to connect to. Different clients may contain different datasets or configurations. |
| Hostname of the Gateway | The hostname or IP address of the SAP gateway, through which communication will be routed. |
| SAP System Number | The system number uniquely identifies an SAP system within a landscape. It is essential for directing communication to the correct SAP system when multiple systems are running on the same host. |
| SAP Logon Language | Specifies the language in which the SAP system should present messages and user interfaces. |
| Logon User | The SAP username with which the connector will authenticate to the SAP system. |

<Callout type="note" title="NOTE">
See more details about [SAP BAPI](/docs/integrations/ipaas-legacy-sap-bapi) with instruction examples and common configuration issues.
</Callout>

<Callout type="note" title="NOTE">
For optional fields that are not filled in, the default value will be applied.
</Callout>

## Configuring a connector

After creating the connector, you must configure it on the **Flow** screen. To do this, follow the steps below:

### Adding the connector to the canvas

<Steps>
<Step>
Access the **Integration Flows** screen and select your integration flow.

If you want to create a new flow, click **+ NEW FLOW** and access the **Flow** screen.

<Callout type="note" title="NOTE">
Check out our tutorial on [how to create your first integration flow](/docs/integrations/ipaas-legacy-create-flow).
</Callout>
</Step>
<Step>
Click the ![hub icon with plus sign](https://creative-ball-51b3fc85c0.media.strapiapp.com/connectors_Icon_1f4432d891.png) icon in the left editing menu.
</Step>
<Step>
Choose the connector you want. 
You can use the search bar to find it.
</Step>
<Step>
Connect it to a previous step if you want to use the properties of other steps.
</Step>
</Steps>

<Callout type="tip" title="TIP">
To copy the step, click the ![copy icon](https://creative-ball-51b3fc85c0.media.strapiapp.com/copy_step_icon_fd3cbe733c.png) button.
If the step form is already configured, the settings are copied as well.
</Callout>

To remove the connector from the canvas, select it and click the ![trash icon](https://creative-ball-51b3fc85c0.media.strapiapp.com/remove_Icon_486c52eeeb.png) button.

### Configuring the form 

<Steps>
<Step>
Select the connector on the canvas.
</Step>
<Step>
Click the edit icon ![pencil icon](https://creative-ball-51b3fc85c0.media.strapiapp.com/edit_icon_34464736ca.png).
</Step>
<Step>
Fill in the following form fields:

* **Name**: enter the connector name.
* **Connector**: select one of the registered connectors.
* **Timeout**: enter the request timeout in milliseconds. 

  By default, the value will be 3000 milliseconds and the maximum value is 60000 ms.

  <Callout type="note" title="NOTE">
  By clicking the ![list icon](https://creative-ball-51b3fc85c0.media.strapiapp.com/properties_icon_2c777edb35.png) icon to the right of the **Timeout** field, you can filter and display environment variables and the payload of previous steps (if the steps are connected) for use in timeout configuration.
  </Callout>

* **Properties**: use environment variables and [properties](/docs/integrations/ipaas-legacy-expression-builder) from previous steps to build your script in **Instruction**.

* **Instruction**: create your script by inserting input attributes or creating an expression by clicking the ![fx button](https://creative-ball-51b3fc85c0.media.strapiapp.com/function_icon_50715399e6.png) button to the right.
  The Concat function is available for creating the expression.
  This field comprises the native syntax of the protocol to which the connector provides access.

* **Ignore Errors**: by default, this button is disabled and you can enable it. 

  Check out more details about the **Ignore Errors** function in the table below:

  | Enabled ![](https://creative-ball-51b3fc85c0.media.strapiapp.com/switch_b7a9c56956.png) | Disabled ![](https://creative-ball-51b3fc85c0.media.strapiapp.com/switch_off_460667d32c.png) |
  |--------------------------------------|-------------------------------------------|
  | Flow execution continues, even if there are errors in the process. | Execution will be stopped immediately. |
  | Logs show the step with error. | Logs show execution up to the step with error. |
  | Following steps will be executed. | No following steps will be executed. |
</Step>
<Step>
Click **SAVE**.
</Step>
</Steps>
