Explain the kinds of actions in RAP: instance, static, factory and internal. What is the difference between an action and a function?
Say your answer out loud first.
Practise another way
An instance action works on existing instances and receives their keys. A static action is not tied to an instance. A factory action creates new instances, and cannot return a result.
An internal action can only be called from inside the business object. Actions modify data and lock; functions only return data and never change anything. For actions you choose a result cardinality like [1] or [0..*], and result $self returns the entity.
Declaration
action acceptTravel result [1] $self;
static action createDemoData;
factory action copyTravel [1];
internal action recalcPrice;
action setStatus parameter ZA_Status;
function getOpenSeats result [1] ZA_Seats;
The kinds
- Instance action: the handler gets
keysand can return aRESULTtable.result [1] $selfmeans one instance of the same entity per input key, useful so the UI can refresh the row. - Static action: not bound to an instance, so there are no keys. Typical use: mass operations or create-with-defaults.
- Factory action: creates instances, including child nodes. It may be instance-bound (copy from an instance) or static. Output parameters are not allowed. Cardinality says how many instances can be created:
[1],[0..1],[0..*],[1..*]. Adefault factoryis used by consumers like OData as the standard create-by-action. - Internal action: only callable from the BO implementation through EML with
IN LOCAL MODE. Use it to share logic between determinations and other actions without exposing it. - Extras you should know:
repeatable(same action several times on one instance in a request),parameter(flat or deep input, an abstract entity),result selective(only part of the result is requested).
Functions
Functions return information, for example a calculation or a read, and must not change data or lock. The output parameter is mandatory.
Controls on an action
features : instance or global (availability), authorization : instance, global or none, precheck, and lock : none to skip locking.
Implementation rule
The handler method is FOR MODIFY IMPORTING keys FOR ACTION Travel~acceptTravel RESULT result. Read once for all keys, change in a loop, and fill result with one line per key, using %tky.
Separates the four action kinds by what they receive and return, names factory actions as the only ones that create instances, and says functions never change data.
Lists 'action' as 'a button' and does not know that factory actions cannot have a result or that functions are read-only.
Saying an action is just a custom update; candidates forget that actions lock the instance by default and that factory actions create rather than change instances.
- How would you let a determination reuse an action without exposing it in OData?
- What does result [1] $self change in the handler?
- When would you pick a function instead of an action?
- How do you control who may call an action?
2 official pages and 1 prep guide. Confidence: high. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Prep guide Gives the question.