RAP Business Objects Part 5: Authorization, Feature Control and Messages
Preview · a free account unlocks the full lesson
Separate three controls that are often confused — authorization (who), feature control (when), and access control (which rows) — and learn how RAP messages reach the user correctly with FAILED, REPORTED, message classes and field highlighting.
In this lessonShow sectionsHide sections
Explanation
Parts 3 and 4 covered transactions and concurrency. This last part covers the controls that decide whether an operation is allowed at all, and how the user actually learns why something was rejected.
There are three distinct controls, and each answers a different question.
Authorization answers who may do it, and depends on the user's roles — "only buyers may create requests." Feature control answers when it's possible, and depends on the data's current state — "approve only when status is Submitted." Access control, through a CDS DCL, answers which rows the user can read at all — "managers see only their region," covered in CDS Views Part 4.
Mixing these up is a classic design error: coding a state rule as authorization sends the support desk chasing missing roles that don't exist, while coding a role check as feature control makes it disappear the moment someone calls the API with different field values.
Authorization is declared with "authorization master ( global, instance )" on the root and "authorization dependent by _Parent" on children.
Global authorization, implemented in get_global_authorizations, covers operations that don't need an instance, such as create or static actions — "may this user create purchase requests at all?" Instance authorization, implemented in get_instance_authorizations, covers operations on an existing instance, such as update, delete, or instance actions — "may this user change request 42?", which might depend on something like its company code.
The implementation uses AUTHORITY-CHECK against the relevant authorization object and returns auth-allowed or auth-unauthorized. For operations that genuinely need no check, "( authorization : none )" should be declared explicitly rather than left to chance.
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.