Service Definitions Part 6: Exposing Multiple Entities and Navigation
Preview · a free account unlocks the full lesson
Expose several entities in one service correctly: composition children, read-only related entities, value helps and text entities — and understand how navigation properties are created or dropped.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Parts 1 through 5 designed services around a root and its items. This final part covers services with more entities involved: related entities, value helps, and the rules governing navigation.
The navigation rule is simple but explains most "missing navigation" questions: for every association in an exposed projection, RAP checks whether the target is also exposed, either directly or as a redirected projection. If it is, a navigation property and a NavigationPropertyBinding entry appear in $metadata, and $expand works; if it isn't, the navigation is simply removed from the service.
Composition children need every child projection the app actually uses to be exposed, and in the projections, associations need to be redirected — _Item redirected to composition child ZC_PurchReqItem, and _Request redirected to parent ZC_PurchReq. With that in place, deep create — header and items in one request — works through the composition navigation.
Read-only related entities can be exposed too, for example when an object page should link to supplier details: a simple read-only projection, such as ZC_SupplierRO on I_Supplier, can be created with no behavior at all, and in ZC_PurchReq, _Supplier gets redirected to it (or the association target can be exposed directly). Once exposed in the service, the supplier becomes readable but not changeable — no BDEF is needed at all for a read-only entity like this.
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
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.