Behavior Definitions Part 2: CRUD, Field Control, Numbering, Locking and Authorization
Preview · a free account unlocks the full lesson
Master the syntax options for standard operations, field characteristics, numbering, locking and authorization — including internal operations, prechecks, readonly:update, mandatory:create and authorization:none.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Part 1 showed the overall structure of the behavior definition. This part works as a reference for the most frequently used options, covering for each one what it means and when to use it.
For the standard operations, create, update and delete are available to all consumers by default. Marking an operation internal create, internal update or internal delete restricts it to being callable only from inside the BO itself, in IN LOCAL MODE — useful, for instance, for a child that is only ever created by an action.
The option ( features : instance ) lets an operation be enabled or disabled per instance via get_instance_features. The option ( precheck ) runs a precheck method before the operation reaches the buffer, which is useful for rejecting obviously invalid input early, such as before draft data gets written.
The option ( authorization : none ) switches off the authorization check for that operation entirely, and should be used deliberately and documented. The option ( authorization : update ) lets an action or operation be checked using the same instance authorization as update.
Field characteristics follow the syntax field ( <characteristic> ) Field1, Field2;. readonly means consumers can never set the field — it's the BO itself that sets it, for things like status, totals, or admin fields. readonly : update means the field can be set on create but never changed afterward, such as an external document number. mandatory means the field must be filled, with Fiori marking it and RAP reporting any missing value, while mandatory : create narrows that requirement to create only. features : instance defers the readonly/mandatory decision to runtime, inside get_instance_features. numbering : managed has the framework assign a UUID key, typically combined with readonly. suppress hides a field from the BO interface entirely, and is available on newer releases.
As much of this as possible should be declared here rather than checked in code.
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.