Lesson 3 of 5
Finding and judging APIs and events
10 min
Listen to this lesson
A side-by-side extension is only as stable as the interfaces it uses. Before Kenji's team writes a line of code for the fleet app, they list every API and event it needs, check that each is released, and record which version they built against. That list later becomes the basis of contract tests.
SAP Business Accelerator Hub
The SAP Business Accelerator Hub (api.sap.com, formerly SAP API Business Hub) is SAP's public catalog of APIs, events and integration content. For each API you can read its documentation, browse the entity sets and operations, download the specification (for OData, the EDMX metadata file), and try calls against a sandbox with sample data after logging in and using the API key shown on the API page. Make sure you pick the right product: SAP S/4HANA (for Private Edition and on-premise) and SAP S/4HANA Cloud Public Edition have separate entries, and an API available in one is not automatically available in the other.
The fleet app needs sales order headers and items, which the Sales Order (A2X) OData API (API_SALES_ORDER_SRV) provides, and business partner data, from the Business Partner (A2X) API (API_BUSINESS_PARTNER). A2X marks APIs meant for consumption by apps and extensions. Both are OData V2 APIs; newer APIs are often OData V4. The developer downloads the EDMX files from the hub, imports them into the CAP project and keeps them in source control, so everyone can see exactly which contract the code was written against.
- List needsWhich business objects, which fields, read or write, how often
- Search the hubFind the API or event for the right product (SAP S/4HANA, not Public Edition)
- Check release and statusReleased for customer use, not deprecated; note any successor
- Check the systemConfirm the service is available and activated in CMD, CMQ and CMP
- Download the specificationEDMX or AsyncAPI-style event reference into source control
- Try itSandbox call on the hub, then a call to CMD with a test user
Released means a contract
SAP marks objects that are safe for customer use as released, with a stability contract: SAP will keep them compatible or announce a successor. Inside the system, ABAP Development Tools show a tree of released objects, and SAP's cloudification repository lists which classic objects have released successors. For remote APIs, the hub shows each API's state. When an API is deprecated, a successor is usually named; plan the move before it is decommissioned rather than discovering it in a regression run.
Availability in the hub is not the same as availability in your system. In Private Edition and on-premise, an OData V2 service generally has to be activated in the gateway (transaction /IWFND/MAINT_SERVICE), and OData V4 service groups are published separately (/IWFND/V4_ADMIN). Some releases also offer communication scenarios and arrangements, the Public Edition way of exposing APIs; check what your release supports. Sam's Basis team activates the services in CMD first and records them as part of the transport so CMQ and CMP match.
Business events
The hub also lists events. Each event has a reference with its type, for example a business partner changed event named in the pattern sap.s4.beh.businesspartner.v1.BusinessPartner.Changed.v1, and an example payload. SAP uses the CloudEvents specification: every message has context attributes such as id, source, specversion and type, plus a data payload. In SAP S/4HANA Private Edition and on-premise, events are configured with Enterprise Event Enablement: a channel to the broker is created in transaction /IWXBE/CONFIG (typically from the broker's service key), and outbound bindings select which topics are published. SAP S/4HANA 2023 added a channel type for SAP Integration Suite, advanced event mesh; check the details for your release.
| Released API (OData, SOAP) | Business event | |
|---|---|---|
| Direction | Extension calls SAP S/4HANA when it needs data | SAP S/4HANA tells subscribers something happened |
| Timing | Synchronous request and response | Asynchronous through a broker |
| Specification | EDMX or other API specification on the hub | Event reference with type and payload schema on the hub |
| Set up in Private Edition by | Activating the service in the gateway | Channel and outbound binding in Enterprise Event Enablement |
| Typical test question | Does the response still match the fields we use? | Do we handle duplicates and late arrivals correctly? |
What would you do?
During design, a developer finds that the internal OData service behind a standard SAP Fiori sales order app returns the delivery status in one call, while the released Sales Order API needs two calls. Priya asks whether that is acceptable. What is the right answer?
- The SAP Business Accelerator Hub catalogs APIs and events, with specifications, documentation and a sandbox.
- Choose the right product entry; Private Edition and Public Edition APIs differ.
- Use released APIs only; watch for deprecation and named successors.
- In Private Edition, services must be activated and events configured (channel and outbound bindings) in each system.
- Keep downloaded specifications in source control; they are the contract your tests check.
Check your understanding · not graded
Lesson check
1. What can you download from an API's page on the SAP Business Accelerator Hub for an OData API?
2. Which transaction configures event channels in SAP S/4HANA Private Edition?
3. Why avoid the internal OData services behind SAP's own Fiori apps?
4. Which attributes are required in every CloudEvents message?