SAP S/4HANA (OData) (Apps step)

Updated Nov 23, 2026
DataMagik Automate

SAP S/4HANA (OData)

Reads entities (products, business partners, sales orders…) from any SAP S/4HANA or SAP Gateway OData v2 service, such as API_PRODUCT_SRV. Reading only: creating and changing SAP data is not offered yet.

Use it to read SAP data into a workflow: look up a product's description and weight for a label, list the sales orders created today, or check a business partner's address before printing a document.

Beta. This step has not yet been checked against a live SAP S/4HANA (OData) account, so treat its first runs as a test, and tell us if an operation does not answer as described.

Find it in the workflow editor's palette under Apps. See Apps steps for what every Apps step has in common.

Set it up

  1. Have your SAP Basis team activate the OData service you need (transaction /IWFND/MAINT_SERVICE on premise; a communication arrangement for it on S/4HANA Cloud) and make a technical or communication user that may read it.
  2. In DataMagik, open Script Engine › Credentials and add a "Basic Auth (Username/Password)" credential with that user's name and password.
  3. Add your SAP host (such as s4.acme.com, or my123456-api.s4hana.ondemand.com for S/4HANA Cloud) to Allowed Domains in the workflow's Script settings.
  4. This step calls SAP from DataMagik over the internet. An on-premise SAP that is not reachable from the internet needs a connector agent on the plant network and an API Bridge resource (Connectors › API Bridge) instead.

Credential: A Basic credential with an SAP user (a technical user on premise, a communication user on S/4HANA Cloud) that may read the OData service.

Hosts it calls: *.s4hana.ondemand.com, *.s4hana.cloud.sap

Connection

FieldRequiredWhat to put
SAP hostYesYour SAP system's host name, with its HTTPS port when it is not 443: s4.acme.com:44300, or my123456-api.s4hana.ondemand.com for S/4HANA Cloud. For example s4.acme.com:44300.

Operations

OperationWhat it does
Entity › ListLists the entities in an entity set of an OData service, optionally filtered, following SAP's next links up to the step's page limit.
Entity › GetReads one entity by its key.

Entity › List

Lists the entities in an entity set of an OData service, optionally filtered, following SAP's next links up to the step's page limit.

Calls GET /{service}/{entitySet}. Follows the pages, up to Most pages (10 unless you change it).

FieldRequiredWhat to put
ServiceYesThe OData service's technical name, such as API_PRODUCT_SRV, API_BUSINESS_PARTNER or API_SALES_ORDER_SRV. For example API_PRODUCT_SRV.
Entity setYesThe entity set in that service, such as A_Product, A_BusinessPartner or A_SalesOrder. For example A_Product.
FilterNoAn OData filter on SAP's field names, such as ProductType eq 'FERT'; leave empty for all. For example ProductType eq 'FERT'.
Fields to returnNoComma-separated field names; leave empty for every field. For example Product,ProductType,GrossWeight.
Most resultsNoReturn at most this many; leave empty for all of them.
FormatNoLeave as JSON: the step reads JSON answers. One of: JSON.

What comes out: One item per entity, with its fields by SAP's names, such as {{ $json.Product }} and {{ $json.ProductType }}, plus {{ $json.__metadata.uri }} (the entity's address, which tells entities apart).

Example: List API_SALES_ORDER_SRV A_SalesOrder with filter SoldToParty eq '{{ $json.customer }}' and email the customer's open orders.

Entity › Get

Reads one entity by its key.

Calls GET /{service}/{entityPath}.

FieldRequiredWhat to put
ServiceYesThe OData service's technical name, such as API_PRODUCT_SRV, API_BUSINESS_PARTNER or API_SALES_ORDER_SRV. For example API_PRODUCT_SRV.
EntityYesThe entity set with the key in brackets, text keys in single quotes: A_Product('TG11'), or with several keys A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10'). A / then a navigation name reads a related entity, such as A_Product('TG11')/to_Description. For example A_Product('TG11').
Fields to returnNoComma-separated field names; leave empty for every field. For example Product,ProductType,GrossWeight.
FormatNoLeave as JSON: the step reads JSON answers. One of: JSON.

What comes out: One item: the entity, with its fields by SAP's names, such as {{ $json.Product }}, {{ $json.ProductType }} and {{ $json.GrossWeight }}, plus {{ $json.__metadata }}. A navigation to many entities (such as /to_Description) puts out {{ $json.results }} with them.

Example: Get API_PRODUCT_SRV A_Product('{{ $json.material }}') and put {{ $json.GrossWeight }} {{ $json.WeightUnit }} on the shipping label.

Trigger: SAP S/4HANA (OData): New Items

Under Triggers in the palette. It looks at SAP S/4HANA (OData) on a schedule (every 15 minutes unless you change Look every) with one of these operations: Entity › List, and starts the workflow with the items it has not seen on an earlier look, one item each. Saving the workflow sets up the schedule.

  • New means: not seen before, by the item's id (or the field you name in Item field), or newer than the newest one last time, by a date or increasing number.
  • On the first run it only remembers what is there, unless you choose Start with everything.
  • Test runs show what would be new without remembering it. It remembers the last 5000 ids, so filter the list to keep it shorter than that.

Example

When a label prints, SAP S/4HANA › Get entity reads API_PRODUCT_SRV A_Product('{{ $json.material }}') and puts {{ $json.ProductType }} and {{ $json.GrossWeight }} on the label.

Tips

  • The SAP Business Accelerator Hub (api.sap.com) lists each OData service, such as API_PRODUCT_SRV or API_SALES_ORDER_SRV, with its entity sets and fields.
  • Filters use OData v2 syntax with SAP's field names: Product eq 'TG11', CreationDate ge datetime'2026-01-01T00:00:00'. Text values go in single quotes.
  • List $select to only the fields you need: SAP entities have many fields, and a short $select makes each call faster.
  • Creating and changing SAP data is not offered yet: SAP asks every write for an x-csrf-token fetched earlier in the same session, with that session's cookie, which this step cannot carry from one call to the next.
  • SAP returns dates as /Date(1767225600000)/, milliseconds since 1970.

Settings every Apps step has

  • More query parameters: any query parameter the fields do not offer, sent as is.
  • More body fields: a JSON object merged into the request body; nested objects merge, other values replace.
  • Most requests per second: spaces the calls out for rate limits. A "too many requests" (429) answer is retried after the wait the API asks for.
  • Most pages: for operations that follow pages, the most pages to fetch (10 unless you change it, up to 100). The run warns when it stops with more to get.
  • Fail on a non-2xx response: on by default. Turn it off to handle errors yourself.

SAP S/4HANA (OData)'s own API documentation: https://api.sap.com/products/SAPS4HANA/apis/ODATA

Was this page helpful?