[◂ Back to examples](https://zato.io/docs/dev/index.html)

SAP

# Integrate SAP with your enterprise systems

Connect SAP S/4HANA, ECC and SuccessFactors from Python. Read and write business partners, sales orders, employees and any other entity over OData, with CSRF tokens, OAuth2, paging and serialization all handled by the platform.

[Downloads](https://zato.io/docs/admin/guide/install/index.html)

## Tutorials

[### OData tutorial Query SAP and Microsoft systems from Python - the protocol that SAP connections use internally](https://zato.io/tutorials/odata.html) [### In-depth API integration tutorial Learn how to design and build scalable, real-world, production-ready API integrations in Python](https://zato.io/tutorials/main/01.html) [### API testing tutorial Test your SAP integrations without access to a real SAP system](https://zato.io/docs/api-testing/tutorial.html)

## How to use the SAP integration

[Create an outgoing SAP connection and use self.sap in services](https://zato.io/docs/dev/sap/index.html) [Fill in the connection form for S/4HANA, ECC or SuccessFactors](https://zato.io/docs/dev/sap/s4hana/index.html) [Configure Basic Auth, Bearer tokens or OAuth2](https://zato.io/docs/dev/sap/security/index.html)

## More examples

[### S/4HANA and ECC Gateway service roots, OData V2 and V4 paths, the sap-client parameter and CSRF token handling](https://zato.io/docs/dev/sap/s4hana/index.html) [### SuccessFactors API server addresses, OAuth2, the employee entity model and server-driven paging](https://zato.io/docs/dev/sap/success-factors/index.html) [### Query options Filter, select, expand, sort and page through SAP entity sets from Python](https://zato.io/docs/dev/sap/query/index.html) [### Security Basic Auth, Bearer tokens and OAuth2 client credentials, with X-CSRF-Token exchanges handled automatically](https://zato.io/docs/dev/sap/security/index.html) [### Testing SAP connections Unit-test services with mocked SAP responses and run live tests against an in-process test server that simulates SAP](https://zato.io/docs/dev/sap/api-testing/index.html) [### Configuration as YAML Define SAP connections declaratively with enmasse and deploy them across environments](https://zato.io/docs/dev/sap/enmasse/index.html) [### Data models Map SAP entities to Python dataclasses for typed access and OpenAPI generation](https://zato.io/docs/dev/model/index.html) [### API configuration Where to keep environment-specific settings - system addresses, clients and credentials](https://zato.io/docs/dev/examples/config.html)

## About SAP

SAP runs core enterprise operations across manufacturing, retail, logistics and finance - S/4HANA and ECC for ERP, SuccessFactors for HR. All of them expose their business data through OData services, which Zato's outgoing SAP connections consume. With Zato, you configure a connection once - address, OData version, credentials - and every Python service can then read and write business partners, sales orders, employees or any other entity, orchestrating SAP with databases, message queues and the rest of your systems.

## Frequently asked questions

### Which SAP products can Zato connect to?

S/4HANA and ECC through Gateway OData services and SuccessFactors through its OData API. See the [S/4HANA and ECC](https://zato.io/docs/dev/sap/s4hana/index.html) and [SuccessFactors](https://zato.io/docs/dev/sap/success-factors/index.html) chapters for the address and auth settings of each.

### How does authentication work?

Basic Auth, Bearer tokens or OAuth2 client credentials, with tokens cached and refreshed automatically. Details are in the [SAP security](https://zato.io/docs/dev/sap/security/index.html) chapter.

### What about CSRF tokens?

SAP Gateway requires an X-CSRF-Token for writes - Zato fetches, caches and refreshes the token automatically, as described in the [security](https://zato.io/docs/dev/sap/security/index.html) chapter.

### How do I read data from SAP?

Obtain a client with [self.sap](https://zato.io/docs/dev/sap/index.html) and call .read, .get or .iter - entities arrive as plain Python dicts, with paging followed transparently.

### Can I write data too?

Yes - .create, .update and .delete cover the full CRUD range against any entity set your SAP user is authorized for.

### Does this replace SAP RFC connections?

Yes - OData is the API layer that SAP publishes and supports for S/4HANA and SuccessFactors, and Zato's SAP connections build on it, with no SAP client libraries to install.

### How do I test SAP integrations?

Mock SAP responses in unit tests or run live tests against the in-process [OData test server](https://zato.io/docs/dev/sap/api-testing/index.html) that simulates SAP auth and validation behavior.

### Can I keep the configuration in version control?

Yes - define connections in YAML with [enmasse](https://zato.io/docs/dev/sap/enmasse/index.html) and import them per environment, with secrets read from environment variables.

## Ready to build SAP integrations?

Get started with Zato and connect SAP to your enterprise systems in minutes.

[Read the SAP chapter](https://zato.io/docs/dev/sap/index.html)
