OData
OData is the protocol at the heart of modern SAP integration and Fiori, a RESTful, resource-oriented standard for querying and updating data over HTTP with JSON. Understanding OData is essential for UIs and cloud integration.
Every Fiori app talks to the backend via OData, and S/4HANA/cloud products expose OData APIs for integration.
- In modern SAP you create OData services from CDS views (via annotations or the RAP model), or classically with the Gateway Service…
- OData exists in versions (V2 widely used in SAP, V4 increasingly adopted).
- Entities & entity sets: resources (e.g. SalesOrder) and collections.
- Watch out: Over-fetching instead of using query options.
Why OData matters in SAP
Every Fiori app talks to the backend via OData, and S/4HANA/cloud products expose OData APIs for integration. It combines REST’s simplicity with powerful, standardised query capabilities, making it ideal for both user interfaces and system-to-system data exchange.
Core capabilities
- Entities & entity sets: resources (e.g. SalesOrder) and collections.
- CRUD via HTTP verbs (GET/POST/PUT/DELETE).
- Query options: $filter, $select, $expand, $orderby, $top/$skip.
- Metadata document describing the service.
Building and consuming
In modern SAP you create OData services from CDS views (via annotations or the RAP model), or classically with the Gateway Service Builder (SEGW). Consumers, Fiori apps, mobile, external systems, call them over HTTP, using query options to fetch precisely what they need.
Versions
OData exists in versions (V2 widely used in SAP, V4 increasingly adopted). Know which version a service uses, as query syntax and features differ.
Common pitfalls
- Over-fetching instead of using query options.
- Confusing OData V2 and V4 syntax/features.
- Not reading the metadata before consuming.