> ## Documentation Index
> Fetch the complete documentation index at: https://docs.helloleo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SAP Integration

> Connect HelloLeo to your SAP S/4HANA

Connect your SAP S/4HANA, in the cloud or on your own servers. Leo and your agents then read your SAP data live, and change it within the rights you give them.

## What you need

* A user in SAP made for HelloLeo, not a person's own account
* The address of your SAP
* Your SAP administrator, for about ten minutes

## S/4HANA Cloud Public Edition

**1. Create the user**

Open **Maintain Communication Users**, click **New**, and give the user a name and a password.

**2. Create the system**

Open **Communication Systems**, click **New**. Under the users for inbound communication, add the user from the previous step.

**3. Open the data**

Open **Communication Arrangements**, click **New**, and pick the scenario that covers the data HelloLeo should reach. Choose the system from the previous step and save. You need one arrangement per scenario: your SAP administrator knows which scenario covers the data you need.

**4. Copy the address**

The arrangement shows the address to use. That is the one to give HelloLeo.

## SAP on your own servers or in a private cloud

**1. Create the user**

Ask your SAP administrator for a technical user, with a role limited to the data HelloLeo should see or change.

**2. Switch on the data services**

Make sure the data services you need are switched on. Your administrator does this in **Activate and Maintain Services** (transaction `/IWFND/MAINT_SERVICE`).

**3. Make it reachable**

Your SAP must be reachable from the internet, on an address that starts with https. If your network only lets known addresses in, contact us for the address to allow.

## Connect in HelloLeo

1. Go to **Project Settings** → **Integrations** and pick **SAP**. For an agent, open its **Integrations** panel instead.
2. Fill in:
   * **SAP address**: the address from your arrangement, or the address of your own SAP. Not the one you open in your browser.
   * **Client**: only if your SAP administrator gave you one. It is the three digits you type when you log on to SAP.
   * **User** and **Password**: the user made for HelloLeo.
3. Click **Test connection**, then save.

## Reading and changing data

HelloLeo can do in SAP what its SAP user is allowed to do, nothing more. To keep it reading only, give that user a role that only reads.

An agent also follows its own **Permissions**: you choose what it may do on its own and what waits for you in **Approvals**. Running an SAP action, like releasing or closing an order, is treated as something that cannot be undone.

## Example prompts

```
Which materials in plant 1000 will run short in the next two weeks?
```

```
List the production orders released this week that are missing components.
```

```
Every morning, email me the parts that are short and the orders they block.
```

## Troubleshooting

### Could not connect

* Check that the address is the data-access one from your arrangement, not the one you open in your browser
* Check the client, or leave it empty
* Each wrong password counts in SAP, and a few in a row lock the user. If that happens, ask your SAP administrator to unlock it

### Leo says it may not read something

The SAP user does not have that data yet. In the cloud, add the arrangement for the matching scenario. On your own servers, extend the user's role or switch the service on.

### Nothing comes back

Ask Leo what it searched for. SAP filters are exact: a plant, a material or a date written differently finds nothing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.