Service Definitions Part 2: Exposing Projection Entities as a Business Service
Preview · a free account unlocks the full lesson
Decide which projection entities form one business service, write the service definition with meaningful aliases, and verify the result in the binding's entity list and $metadata.
In this lessonShow sectionsHide sections
Visual overview
Explanation
A service represents a business capability — "maintain purchase requests" — and should expose everything that capability needs and nothing more. That generally means exposing the root plus all composition children used by the app. The aliases chosen in the service definition become entity set names, both in OData and in client code, so after activation it's worth checking the binding's entity list and the resulting $metadata.
Part 1 introduced the business object itself; this part is about deciding what actually goes into one service.
The right way to think about this is in terms of capabilities, where a service supports one business capability for one type of consumer. ZUI_PURCHREQ might let buyers maintain purchase requests in a Fiori app, ZUI_PURCHREQ_APPROVE might let approvers review and approve them, and ZAPI_PURCHREQ might let external systems create and read requests. Each of these gets its own projections and its own service definition. Trying to build "one service for everything" instead makes every change risky for every consumer at once.
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.