Requirement: employees submit expense claims with line items, managers approve or reject them, and finance's system needs an API to read approved claims. Sketch the RAP business object you would build and defend each choice.
Say your answer out loud first.
Practise another way
One managed, draft-enabled BO: Claim as root, Item as composition child, both on UUID keys with managed numbering and a readable claim number set on save.
Locking, total ETag and instance authorization sit on the root. Approve and reject are instance actions with feature control by status, validations check amounts and dates, a determination sums the total.
I expose two projections: a V4 UI service with draft for employees and managers, and a read-only Web API for finance, plus an event on approval.
Data model
ZR_Claim(root) andZR_ClaimItem(composition child); employee, cost center and currency as plain associations to released views.- UUID keys with
numbering : managed; a readableClaimIDset by anon savedetermination, as SAP's Flight scenario does withsetTravelNumber.
Behavior (base BDEF, abbreviated)
managed implementation in class zbp_r_claim unique;
strict ( 2 );
with draft;
define behavior for ZR_Claim alias Claim
persistent table zclaim draft table zclaim_d
lock master total etag LastChangedAt
authorization master ( global, instance )
etag master LocalLastChangedAt
{
create; update; delete;
association _Item { create; with draft; }
field ( readonly ) ClaimID, Status, TotalAmount;
action ( features : instance ) approve result [1] $self;
action ( features : instance ) reject parameter ZA_RejectReason result [1] $self;
validation checkSubmitter on save { create; }
draft action Edit; draft action Activate optimized;
draft action Discard; draft action Resume; draft determine action Prepare;
}
(The item entity is lock dependent and authorization dependent by its to-parent association.)
Why these choices
- Managed: new tables, no legacy API; least code.
- Draft: claims are typed over several minutes with attachments; users must leave and resume.
- Instance authorization for approve: only the cost center's manager. Read protection through a CDS access control on the projection.
- Feature control: approve and reject only when Status is Submitted; edits locked after approval.
- Status as read-only field changed only by actions using
IN LOCAL MODE. - Total: an item determination calls an internal action that recalculates
TotalAmount, like the Flight scenario'sreCalcTotalPrice; a side effect refreshes it on screen while editing.
Exposure
- UI projection
ZC_Claimwithuse draftand an OData V4 UI binding. - API projection for finance: read-only, only approved claims, OData V4 Web API. SAP's Flight scenario shows that a draft BO can be projected without draft (
/DMO/C_Travel_A_Dhas nouse draft). - A business event
ClaimApprovedraised in the save, so finance can react instead of polling.
What to defer Collaborative draft, attachments as a separate BO, and extensibility enablement until there is a consumer for them. Saying what you leave out shows judgment.
Produces a coherent BO with concrete BDEF lines, justifies managed, draft, authorization, feature control and numbering, and separates UI and API projections with an event for integration.
Lists every RAP feature without tying it to the requirement, or designs one service for both users and finance with no authorization story.
Skipping authorization in the design. A RAP app with actions but no instance authorization lets any user with the app approve any claim.
- How would you make sure only the right manager can approve?
- Why not let finance read the tables directly?
- What changes if the claim must be posted through an existing BAPI?
4 official pages. Confidence: high. Checked 2 Dec 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.