Skip to the page
DataMosaic

Docs · Connecting to data

SAP

Read SAP S/4HANA or ECC through its OData services — as a check's data source, or from a workflow. Read-only.

A check or a workflow reads rows from SAP, such as a plant's stock, a day's billing documents or a list of products, through the OData services SAP already publishes.

It only reads. Mosaic sends SAP GET requests and nothing else, and there is no setting that changes that. Mosaic sees your source systems and does not change them. The user it logs on with needs no right to change anything.

#Where SAP appears

SAP is kept in one place, under Systems, and read from there in two ways:

  • By a check, through a data source made from the SAP System, on the SAP driver under Services. This is what a check compares: the ERP side of the POS says 91, the ERP says 86. See SAP as a data source.
  • By a workflow, with the SAP node, which reads the SAP System. For example, a workflow can read the stock of the plants a check found out, and post them to Teams.

The System keeps the address and the logon once. Change the password there, and every check and workflow reading SAP uses the new one. Both read the same way, so a row from SAP looks the same in a check and in a workflow.

SAP was also a connector for a while. A Mosaic that still has an SAP connector moves it under Systems when it starts, with its logon, and the workflows that read it carry on.

#SAP as a data source

Pick SAP under Services when adding a data source. The form has two halves.

Where SAP is: Address, Client, Username, Password, Language, Timeout (ms), and Verify TLS certificate. Turn that off only for an SAP host inside your network whose certificate your own CA signed. A system fills this half in.

What to read:

FieldWhat goes in it
ServiceA service's name, such as API_MATERIAL_STOCK_SRV, or for an OData V4 service its path from /sap/ onwards
Entity setAs the service publishes it: A_MatlStkInAcctMod. A key, A_Product('TG11'), reads one entity
FilterOData's $filter, as written. It takes the check's parameters: Plant eq '{{plant}}'
ColumnsOData's $select, separated by commas. Blank reads every column
Order byOData's $orderby
Max rows50,000 to start with, 250,000 at most. A run that stops there says so

Every page is followed to the end. Each entity is one row, cleaned as below. A field made of several parts, such as an address, becomes dotted columns: Address.CityName. A list inside a row becomes its JSON text.

Test connection reads the service's metadata, which proves the address, the client, the logon and the user's right to read that service. With no service named yet, it asks Gateway's list of services instead. A run's record shows the request it sent, with the password left out.

#The SAP System

#Setting it up

Ask whoever runs SAP for a technical user that may read the services you want, with those services activated in Gateway (transaction /IWFND/MAINT_SERVICE). On S/4HANA Cloud, a communication arrangement gives you the user and the -api address.

FieldWhat goes in it
AddressWhere the system answers over HTTPS, with no path: https://s4.example.com:44300. On S/4HANA Cloud, the -api address. A path pasted on the end is ignored
ClientOptional. The three-digit client to log on to, sent as sap-client. Blank uses the system's default client
User and PasswordThe technical user
ServiceOptional. A service this user may read, such as API_PRODUCT_SRV. Test connection asks for it, and the node uses it when it names no service of its own
Language (under Advanced)Optional. The logon language, such as EN, sent as sap-language. Blank uses the user's own

Test connection logs on with what is in the form:

  • With a Service to test with, it reads the service's metadata and says which OData version it speaks and which entity sets it publishes.
  • Without one, it asks Gateway for its list of services. A technical user is usually refused that list. The test then says the logon worked, and asks you to name a service.

Nothing is saved until you press Save. A password saved for one address is not sent to another, so if you change the address, type the password again. The password is encrypted with the same key file as a data source password, and comes back as bullets.

With more than one SAP System in a workspace, the node reads the one its System field names, or the one that serves the store in Place.

On Mosaic Cloud, an SAP system inside a private network cannot be reached. For an SAP system behind your firewall, run Mosaic on your own server.

#What the rows look like

Each entity comes out as one item, with its fields as SAP names them: Material, Plant, MatlWrhsStkQtyInMatlBaseUnit. Some things are cleaned up on the way:

  • OData V2's __metadata, and links to navigation properties that were not expanded, are taken out. So are OData V4's @odata annotations.
  • V2 dates written /Date(1764201600000)/ become dates. A date at midnight with no offset, which is how SAP sends a posting date, becomes the day alone: 2025-11-27. Times written PT14H05M09S become 14:05:09.
  • Amounts and quantities stay as SAP sends them, as text such as 10.000. Keys such as material numbers keep their leading zeros.

The node follows SAP's pages to the end (__next in V2, @odata.nextLink in V4), up to At most this many rows. A next page pointing at another address is not followed, so the logon is never sent anywhere else.