> For the complete documentation index, see [llms.txt](https://docs.melibo.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.melibo.de/configure/integrationen/erp-systeme/sap-sap-gateway.md).

# SAP (SAP Gateway)

Aktiviere das SAP Gateway, richte einen OData-Service ein und verbinde SAP mit melibo.

Mit der SAP-Integration (über das SAP Gateway) kann dein AI Agent Daten aus deinem SAP-System abrufen.

***

### Voraussetzungen

Bevor du beginnst, stelle sicher, dass:

* du Admin-Zugriff auf dein SAP-System hast.
* der SAP NetWeaver Gateway installiert ist.
* du Berechtigungen für die Transaktionen **SEGW**, **SPRO** und **/IWFND/MAINT\_SERVICE** besitzt.

***

### Schritt 1 – SAP Gateway aktivieren

Der SAP Gateway stellt OData-Services bereit, über die du strukturierte SAP-Daten per HTTP abrufen und schreiben kannst.

1. Öffne die Transaktion **SPRO**.
2. Navigiere zu **SAP NetWeaver > Gateway > OData Channel > Administration > General Settings > Activate/Deactivate SAP Gateway**.
3. Stelle sicher, dass der SAP Gateway Service aktiviert ist.

{% hint style="warning" icon="triangle-exclamation" %}
**Achtung:** Wenn der Gateway-Service deaktiviert ist, können keine OData-Endpunkte veröffentlicht werden.
{% endhint %}

***

### Schritt 2 – OData-Service anlegen

1. Öffne die Transaktion **SEGW (SAP Gateway Service Builder)**.
2. Erstelle ein neues Projekt.
3. Definiere deine Datenmodelle (Entities).
4. Implementiere die Service-Operationen, z. B. Lesen, Schreiben oder Aktualisieren.

Nach der Implementierung steht der Service als API-Endpunkt zur Verfügung.

***

### Schritt 3 – Service registrieren

1. Öffne die Transaktion **/IWFND/MAINT\_SERVICE**.
2. Füge deinen neuen Service hinzu.
3. Registriere ihn im SAP Gateway (IWFND).

Nach erfolgreicher Registrierung kannst du den Service direkt im Browser oder mit Postman testen.

***

### Schritt 4 – API-Endpunkt ermitteln

Nach der Registrierung findest du die URL deines Endpunkts im folgenden Format:

```
https://<sap-server>:<port>/sap/opu/odata/sap/<service_name>
```

**Beispiel:**

```
https://sap-demo-server:44300/sap/opu/odata/sap/ZCUSTOMER_API/
```

{% hint style="info" %}
**Hinweis:** Standardmäßig wird der Service als OData V2 bereitgestellt. Neuere Systeme wie S/4HANA unterstützen auch OData V4.
{% endhint %}

***

### Schritt 5 – Authentifizierung einrichten

#### Basic Authentication (Standard)

SAP unterstützt standardmäßig Basic Authentication mit SAP-Benutzername und Passwort.

{% hint style="warning" icon="triangle-exclamation" %}
**Achtung:** Verwende Basic Authentication ausschließlich über HTTPS – andernfalls werden deine Zugangsdaten unverschlüsselt übertragen.
{% endhint %}

#### Token-basierte Authentifizierung (optional)

In SAP ECC ist Token-basierte Authentifizierung (z. B. JWT) nativ nicht verfügbar. Du kannst sie jedoch über ein externes Token-Management-System einrichten, z. B. via SAP CPI, Apigee oder ein eigenes OAuth-Proxy-System.

Für Cloud-Systeme wie SAP S/4HANA Cloud oder SAP BTP ist Token-basierte Authentifizierung standardmäßig verfügbar und wird über den **SAP Identity Authentication Service (IAS)** verwaltet.

***

### In melibo einzutragen

Trage die folgenden Werte in melibo unter **Configure > Integrationen > SAP (SAP Gateway)** ein:

| Feld in melibo     | Wert / Beschreibung                          | Woher bekommst du ihn?                       |
| ------------------ | -------------------------------------------- | -------------------------------------------- |
| API-Endpunkt (URL) | Die OData-Service-URL deines SAP-Systems     | SAP Gateway (nach Registrierung des Service) |
| Benutzername       | Dein SAP-Benutzername                        | SAP-System                                   |
| Passwort           | Dein SAP-Passwort (bei Basic Authentication) | SAP-System                                   |

{% hint style="info" %}
Die genauen Feldbezeichnungen bitte im melibo-Integrations-Dialog gegenprüfen.
{% endhint %}

***

### Nächste Schritte

* [Actions in Workflows nutzen](https://docs.melibo.de/build/topics/workflows/actions) – SAP-Actions im Workflow einsetzen
* [Secrets](https://docs.melibo.de/configure/einstellungen) – Zugangsdaten sicher hinterlegen
* [Technische Anforderungen](https://docs.melibo.de/configure/integrationen/technische-anforderung-integration) – Allgemeine Anforderungen für Integrationen


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.melibo.de/configure/integrationen/erp-systeme/sap-sap-gateway.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
