Your RAP object needs a door
A RAP business object with behavior but no service is like an app with no UI — technically complete, practically unreachable. The service binding is what exposes your BO to the outside world as OData.
There are two layers: the service definition (which entities are exposed) and the service binding (how — OData V2 or V4, UI or API). Getting the binding type right determines what your consumers can do.
Service definition: what gets exposed
@EndUserText.label: 'Sales Order Service'
define service ZUI_SALESORDER {
expose ZC_SalesOrder_TP as SalesOrder;
expose ZC_SalesOrderItem_TP as SalesOrderItem;
}
Note it exposes the projection (ZC_), not the base interface (ZI_). The projection is the curated public face of your object — fields hidden, actions whitelisted, texts resolved. Exposing the raw interface leaks internals.
OData V4 UI: the modern default
OData V4 with UI is what Fiori Elements expects. Draft handling, value helps, actions as buttons, message handling — the full Fiori experience only works over V4.
Building a new Fiori Elements list report / object page app? This is your binding, full stop. V4 carries the draft protocol, batch semantics, and metadata annotations that Fiori Elements consumes.
New Fiori UI = OData V4 UI binding. This is the one choice in the binding dialog you should make without hesitation.
OData V2: the compatibility play
OData V2 exists for consumers that don't speak V4: older SAPUI5 apps, third-party integrations, Excel-based workflows, some SAP standard consumers.
V2 bindings have real limitations — draft support is partial, some V4-only annotations don't translate, and you're on the older protocol forever. Use V2 when a specific consumer demands it, not as a default.
UI vs API vs both
The binding dialog also asks about the service flavor:
- UI: full Fiori feature set — draft, value helps, actions. For human users.
- API (web API): stripped-down, stable contract for system integration. No UI-only features.
- Both: one binding serving UI and API consumers. Convenient, but think about whether your UI field set is really your integration contract.
My rule: separate bindings for UI and API when the consumers diverge. A field you hide from the UI for clarity might be exactly what the integration needs — or vice versa.
Binding checklist
- Expose the projection, never the base interface.
- V4 UI for new Fiori Elements apps; V2 only for legacy consumers.
- Publish the binding after changes — unpublished bindings serve stale metadata, and stale metadata causes the weirdest UI bugs.
- Test the service document (
/sap/opu/odata4/.../$metadata) directly when the UI misbehaves — it separates service problems from UI problems in seconds.
When a Fiori app shows wrong fields, missing actions, or stale labels, the service binding is suspect number one. Check publication state and binding type before debugging anything else.
V2 or V4 in your landscape — and what's keeping the V2 ones alive? Tell me in the comments.