Skip to content

SAP Connection

This section shows how to connect to an SAP source system.

Prerequisites

Before connecting to SAP for the first time, set up an SAP dialog user with the necessary SAP user rights.

Create an SAP Connection

Use the following endpoint to create a new connection to an SAP application server:

POST /v1/connections/sap/{name}
POST /v1/connections/sap/source HTTP/1.1
Host: localhost:1337
Content-Type: application/json
Content-Length: 109

{
"Host": "sap-erp-as05.example.com(1)",
"User": "alice",
"Password": "myPassword",
"Client": "800",
"Language": "en",
"InstanceNo": 0
}
  1. Input values for the SAP connection can be found in the Properties of the SAP Logon Pad or they can be requested from the SAP Basis team.
curl -X POST \
     -H '[Content-Type: application/json]' \
     -H '[Content-Length: 142]' \
     -d '"Host": "sap-erp-as05.example.com", "User": "alice", "Password": "myPassword", "Client": "800", "Language": "en", "InstanceNo": 0' \
     'http://localhost:1337/v1/connections/sap/source'
fetch('http://localhost:1337/v1/connections/sap/source', {
  "method": "POST",
  "headers": {
    "[Content-Type": "application/json]",
    "[Content-Length": "142]"
  },
  "body": JSON.stringify("Host": "sap-erp-as05.example.com", "User": "alice", "Password": "myPassword", "Client": "800", "Language": "en", "InstanceNo": 0)"
});

When this endpoint is called, the Xtract Core web server tries to establish a connection to the SAP system with the given credentials before saving the connection.

Tip

The Content-Length property in the header represents the byte size of the JSON string in the request body. When using curl, the Content-Length can be determined automatically. The -v (verbose) option returns the request details, including Content-Length.

Test the SAP Connection

Use the following endpoint to check if an existing SAP connection can succesfully connect to the specified SAP system:

GET /v1/connections/sap/{name}/test HTTP/1.1
Host: localhost:1337
curl -X GET 'http://localhost:1337/v1/connections/sap/{name}/test'
fetch('http://localhost:1337/v1/connections/sap/{name}/test', {"method": "GET"});

When this endpoint is called, the Xtract Core web server opens a connection to SAP using the information that is stored in the configuration of the connection. If no connection can be established, Check the Accessibility of the SAP System and the SAP User Rights of the SAP dialog user.


Last update: September 5, 2025