ERPClimb logoERPClimb
RAP Basics
Architect / Cross-trackintermediate 7 min read

RAP Basics Part 8: Service Definition, Service Binding and OData Exposure

Preview · a free account unlocks the full lesson

Key takeaway

Expose a RAP BO: service definition (which projections, with aliases), service binding types (OData V2/V4, UI/Web API), publishing locally or via transport, the Fiori Elements preview, released APIs, and why UI and API consumers get separate services.

In this lessonShow sections

Visual overview

RAP Basics Part 8: Service Definition, Service Binding and OData Exposure — learning sheetFlow: Create service definition ZUI_TRAVEL exposing the projection views → Create binding ZUI_TRAVEL_O4 (OData V4 – UI) and publish → Open the Fiori Elements preview and test create/edit/actions → For integration: create ZAPI_TRAVEL service definition + Web API binding. Key ideas: SERVICE DEFINITION; SERVICE BINDING; PUBLISHING; PREVIEW AND TEST. Watch out: Exposing the UI projection as the integration API ties partners to UI changes — use a separate API projection and binding.ERPClimb.com / ARCH / LESSON 8/11 / LEARNING SHEETRAP Basics Part 8: Service Definition, Service Binding andOData Exposure1 · HOW IT FLOWS1Create servicedefinitionZUI_TRAVEL…2Create bindingZUI_TRAVEL_O4(OData V4 – UI)…3Open the FioriElements previewand test…4Forintegrationcreate ZAPI_TRAVELservice definition + Web…2 · KEY IDEAS EXPLAINEDService Definitiondefine service ZUI_TRAVEL { expose ZC_Travel asTravel; expose ZC_Booking as Booking; }Also expose value-help views used in theprojection if needed.Service BindingCreated in ADT from the service definition; choosebinding type.OData V4 – UI is the default for new FioriElements apps (draft works best with V4).PublishingADT: Publish button on the binding (on-premise:local service endpoint).Transport: the binding is transported; in eachsystem it must be published (V4: /IWFND/V4_ADMINservice group, V2: /IWFND/MAINT_SERVICE).Preview And TestPreview button on an entity set in the bindingopens a Fiori Elements app — no UI5 code.Check $metadata; test with Gateway client orPostman.3 · REMEMBER · WATCH OUTRememberService definition = what is exposed (expose ZC_Travel as Travel);service binding = how (protocol and purpose).Binding types: OData V4 – UI, OData V2 – UI, OData V4 – Web API, ODataV2 – Web API (plus InA/SQL for analytics).UI bindings carry UI annotations for Fiori Elements; Web API bindingsare for machine consumers and ignore UI metadata.!Watch outExposing the UI projection as theintegration API ties partners to UIchanges — use a separate APIprojection and binding.4 · IN A REAL PROJECTA client exposed its RAP UI service directly to a logistics partner through CPI. Six months later a UIenhancement renamed two fields in the projection for better Fiori labels, and the partner interface failedovernight. The architect introduced a dedicated API projection (provider contract transactional_interface)…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Parts 2 through 7 built the business object; now we make it reachable. A service definition declares what is exposed — define service ZUI_TRAVEL { expose ZC_Travel as Travel; expose ZC_Booking as Booking; } — and can also expose any value-help views the projection needs; the aliases used here become the entity set names in $metadata.

A service binding then declares how the service is exposed, in terms of protocol and purpose, and is created in ADT directly from the service definition by choosing a binding type: OData V4 – UI is the default for new Fiori Elements apps and works best with draft, OData V2 – UI is only needed when the UI technology specifically requires V2, and a Web API binding (OData V2 or V4) is for integration with systems like CPI or other external consumers, with no Fiori preview available for those. There's also an InA/SQL binding type for analytics.

UI bindings carry the UI annotations needed for Fiori Elements, while Web API bindings are built for machine consumers and simply ignore UI metadata. Publishing a binding registers the service — in ADT this is the Publish button on the binding itself (a local service endpoint on-premise).

The binding is transported as an object, but in each target system it still needs to be published there too: for OData V4 this happens through the /IWFND/V4_ADMIN service group, and for OData V2 through the familiar /IWFND/MAINT_SERVICE — there's no SEGW and no /IWFND/MAINT_SERVICE step for V4 itself.

On SAP BTP ABAP Environment, Web APIs additionally need a communication scenario and arrangement created alongside publishing.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.