Behavior Implementations Part 3: Actions, Results and User-Facing Messages
Preview · a free account unlocks the full lesson
Implement every kind of RAP action correctly — instance actions with results, actions with parameters, factory actions with MAPPED — and give users clear, translatable messages from message classes.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Part 2 covered automatic logic. Actions are the explicit business steps that users and APIs trigger, and this part shows the implementation pattern for each action type along with how to communicate the results.
For an instance action with a result — "action approve result [1] $self" — the pattern is to optionally read and check preconditions that feature control doesn't already cover, such as amount limits, reporting failures per instance where needed, then run MODIFY ENTITIES … IN LOCAL MODE for the valid instances, and finally READ ENTITIES … ALL FIELDS for those instances to fill the result with %tky and %param set to the instance, so the UI refreshes without a reload.
IN LOCAL MODE matters here because the action changes read-only fields such as Status, which ordinary consumers aren't allowed to change directly.
The UI's button state should never be trusted on its own, since an API can call any action regardless of what the UI shows — feature control automatically rejects calls made in the wrong state, and any additional business checks belong inside the action itself, or in a precheck.
An action with a parameter, such as "action reject parameter ZD_RejectReason result [1] $self", receives its input in %param on each key — for example keys[ … ]-%param-Reason. The parameter should be validated, for instance making the reason mandatory and reporting a failure if it's missing, and Fiori Elements automatically shows a dialog built from the abstract entity's fields.
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
Interview questions on this topic
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.