One action needs no result, one should return the changed travel, and one should return a different entity. How do you declare each action's result in the BDEF, and what does the caller actually get back?
Say your answer out loud first.
Practise another way
I declare results only where a caller needs data. No result means the caller gets only FAILED and REPORTED.
With result [1] $self I fill RESULT with %tky and %param, the updated instance, so the client can show the new state without a second read. With result [1] entity I return another entity's type. With selective, I return only the requested fields.
BDEF options (SAP BDL cheat sheet):
action markChecked;
action ( features : instance ) acceptTravel result [1] $self;
action findCheapest result [0..1] entity ZR_FlightOffer;
action deductDiscount deep result selective [1] ZA_DiscountResult;
factory action copyTravel [1];
- No result. The handler signature has no
RESULT. A caller learns success or failure fromfailed, and messages fromreported. result [1] $self. The result type is the entity itself. SAP's/DMO/BP_TRAVEL_Dupdates the statusIN LOCAL MODE, reads the travels again and returns them:
READ ENTITIES OF zr_travel IN LOCAL MODE
ENTITY Travel ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(travels).
result = VALUE #( FOR t IN travels ( %tky = t-%tky %param = t ) ).
result ... entity X. The result has the type of another CDS entity, useful when the action computes something that is not the instance.selective. The method gets aREQUESTparameter that marks the fields the caller wants. Return only those, for example keys only, to save work.- Cardinality
[0..1],[1],[0..*]or[1..*]states how many rows a caller can expect per key.
What the caller gets. In EML:
MODIFY ENTITIES OF zr_travel
ENTITY Travel EXECUTE acceptTravel FROM VALUE #( ( %tky = key ) )
RESULT DATA(res) FAILED DATA(f) REPORTED DATA(r).
res holds %param per key. Over OData V4, a client such as a Fiori elements app can use a returned instance to refresh the object without another GET. Check the response body in the network trace for your service.
Factory actions are different. They create instances, so output parameters are not allowed. The new keys come back in mapped, linked by %cid.
Repeatable actions. Since ABAP Platform 2022 and SAP BTP ABAP environment 2208, repeatable action allows several executions on the same instance in one request. Its derived type gets an extra %cid.
Practical rule. Declare $self for status actions a UI calls. Leave the result out for fire-and-forget actions. An unused result costs a read per call.
Distinguishes no result, $self, entity and selective, fills %tky and %param after a local read, and knows factory actions return keys in MAPPED instead.
Declares result $self everywhere without filling RESULT, or tries to declare a result on a factory action.
Declaring result [1] $self but leaving RESULT empty. The caller then gets nothing back for a successful action, and a UI may show stale data.
- Why does the action read the travel again after updating it instead of returning the input?
- When would you choose selective, and what does REQUEST contain?
- What does a Fiori elements app do differently for a factory action?
4 official pages. Confidence: high. Checked 3 Dec 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.