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

# SAP S/4HANA

> Explore top predictions for intelligent ERP.

## Supported syncing

| Sync Type | Description | Supported Sync Modes | API documentation |
| - | - | - | - |
| **Sales Orders** | Sync data from any source to SAP S/4HANA as sales orders | Upsert, Update, Insert | [Sales Orders](https://api.sap.com/api/API_SALES_ORDER_SRV/resource/Sales_Order_Header) |

For more information about sync modes, refer to the [sync modes](https://docs.hightouch.com/syncs/types-and-modes.md#sync-modes) docs.

## Connect to SAP S/4HANA

Go to the [**Destinations** overview page](https://app.hightouch.com/destinations?from=docs) and click the **Add destination** button. Select **SAP S/4HANA** and click **Continue**.

Choose the environment that you would like to connect to SAP S/4HANA in. This will be either **Sandbox** or **Production**.

For **Sandbox** environments, input your API key. You can find your sandbox API key in any of the API resource pages, such as [this page for sales orders](https://api.sap.com/api/API_SALES_ORDER_SRV/tryout).

> [!WARNING]
>
> Make sure that your API key has read and write access to your SAP S/4HANA instance.

For **Production** environments, you will need to set up the following in your Communication Management app:

* Communication Users
* Communication Systems
* Communication Arrangements

Use these guides from SAP S/4HANA to create communication arrangements with the necessary permissions and a user:

* [Maintaining communication users](https://help.sap.com/docs/SAP_S4HANA_CLOUD/0f69f8fb28ac4bf48d2b57b9637e81fa/eef80dda3867461c92ac1273689ed36f.html)
* [Creating communication arrangement](https://help.sap.com/docs/SAP_S4HANA_CLOUD/0f69f8fb28ac4bf48d2b57b9637e81fa/fab3fd449cf74c6384622b98831e989e.html)
* [Introductory guide to testing your API](https://help.sap.com/doc/e9d1daf327b943c99ae274c8a9871509/Cloud/en-US/Testing%20SAP%20S4HANA%20Cloud%20API%20Services.pdf)

Once you have completed setting up the above, enter the following fields to connect  to SAP S/4HANA:

* **Host**: You can get this from the API environment that you can see in the communication arrangement you activated earlier. In your SAP S/4HANA URL, this is the first section of the URL after the `https://` prefix, i.e [https://HOSTNAME.s4hana.ondemand.com](https://HOSTNAME.s4hana.ondemand.com).
* **Port**: The default value is 443. You can also find this value the communication arrangement.
* **User**: Username of the user created in Communication Management.
* **Password**: The password for the user specified above.

## Sync configuration

Once you've set up your SAP S/4HANA destination and have a [model](https://docs.hightouch.com/getting-started/concepts.md#models) to pull data from, you can set up your sync configuration to begin syncing data. Go to the [**Syncs** overview page](https://app.hightouch.com/syncs?from=docs) and click the **Add sync** button to begin. Then, select the relevant model and the SAP S/4HANA destination you want to sync to.

### Sync mode

Hightouch supports **Upsert**, **Update**, and **Insert** mode with the SAP ODATA API for Sales Orders.

### Field mapping

Hightouch supports syncing the Sales Order object and its nested fields.

Use Hightouch's object inline mapping to construct SAP S/4HANA's object values from your source.

### Record matching

In **Update and Upsert mode**, Hightouch requires a unique identifier in your model with item IDs from SAP S/4HANA. Rows without item IDs will fail to sync.

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).
