REST
Quick answer
Prefer REST/OData for UIs, mobile, and modern web integrations, and whenever you consume S/4HANA cloud APIs.
Key takeaways
- SAP’s primary RESTful interface is OData, a standardised REST protocol returning JSON, with rich query options.
- OData supports $filter, $select, $expand, $orderby and paging ($top/$skip), so clients fetch exactly what they need.
- In SAP, "REST API" in practice usually means OData services.
- Watch out: Over-fetching without $filter/$select/$top.
REST and OData in SAP
SAP’s primary RESTful interface is OData, a standardised REST protocol returning JSON, with rich query options. OData services expose SAP business data and operations to Fiori, mobile apps, and external systems. S/4HANA and cloud products publish many OData APIs (on the Business Accelerator Hub), and you can build your own from CDS.
A REST/OData call
GET /sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder?$filter=SoldToParty eq '1000'&$top=20
Authorization: Bearer <token>
Accept: application/jsonQuery options
OData supports $filter, $select, $expand, $orderby and paging ($top/$skip), so clients fetch exactly what they need. This precision keeps integrations efficient, request minimal data rather than pulling everything and filtering client-side.
When to use it
Prefer REST/OData for UIs, mobile, and modern web integrations, and whenever you consume S/4HANA cloud APIs. It is the strategic direction; reserve SOAP and RFC for classic or SAP-to-SAP scenarios.
Common pitfalls
- Over-fetching without $filter/$select/$top.
- Ignoring OData error handling.
- Using RFC/SOAP where OData fits better.
Want to learn this properly?
Our live, instructor-led SAP Training covers this hands-on, with real projects and a certification path.
Check your understanding
Which statement is true of REST?
- A. SQL is the primary language for querying and manipulating data in HANA, and SQLScript extends it for…
- B. OData services expose SAP business data and operations to Fiori, mobile apps, and external systems.
- C. These CDS examples show Core Data Services views, the modern SAP modeling layer, with joins, associations…
Show answer
B. OData services expose SAP business data and operations to Fiori, mobile apps, and external systems.
Covered in the “REST and OData in SAP” section of this lesson.
Which of these also applies to REST?
- A. Insufficient memory for the dataset.
- B. S/4HANA and cloud products publish many OData APIs (on the Business Accelerator Hub), and you can build your…
- C. Row-by-row processing instead of set-based SQL.
Show answer
B. S/4HANA and cloud products publish many OData APIs (on the Business Accelerator Hub), and you can build your…
Covered in the “REST and OData in SAP” section of this lesson.
Which part of the Learn SAP curriculum covers REST?
- A. SAP installation
- B. SAP modules hub
- C. SAP APIs
Show answer
C. SAP APIs
This lesson sits in the SAP APIs section of the Learn SAP course.