ABAP for Cloud Development
AS ABAP Release 914, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP RAP Business Objects → RAP - Behavior Definitions → RAP - BDL for Behavior Definitions → RAP - Managed and Unmanaged Behavior Definitions → RAP - EntityBehaviorDefinition → RAP - EntityBehaviorBody →
RAP - group
Syntax
...
group Group1 implementation in class Class1 unique
{
// implementation-relevant content
}
group Group2 implementation in class Class2 unique
{
//implementation-relevant content
}
group Group3 ...
...
Description
Grouping divides the implementation-relevant parts of a business object's business logic into multiple groups for behavior implementation. Each group is assigned to a separate implementation class. This allows the implementation of a business object to be divided technically into multiple parts. Otherwise, the implementation could be done only by one person at a time, since the CCIMP include prevents simultaneous work.
If used, the following implementation-relevant parts of a BDEF must be included in a group (in both a managed and an unmanaged RAP BO):
- actions
- determinations
- validations
- feature control (for fields and for RAP BO operations)
- In an unmanaged RAP BO, the following operations must be included in a group:
- The standard operations
create
,read
,update
, anddelete
. - Operations for associations
Lock
- the RAP locking mechanism for the lock master entity must be assigned to a group.
Not allowed within a group is:
- Type mapping (no implementation required)
Optionally inside or outside of a group:
- In a managed RAP BO,
create
,update
, anddelete
and operations for associations can be specified either inside or outside of a group. - Field additions that do not require an implementation.
Further rules:
- When grouping is used, an implementation class on entity level is not allowed.
- Example: this is not allowed
define behavior for MyEntity alias MyAlias implementation in class ClassName unique
- An implementation class in the RAP behavior definition header that applies to the complete BO with all subnodes is allowed.
- Example: this is allowed:
managed implementation in class ClassName unique
- Different groups can be implemented in the same implementation class.
- The group names
Group1
,Group2
, ... must not conflict with actions, determinations, or validations of the same name. - For RAP BO consumers, the group names are irrelevant and therefore, group names can be changed retrospectively.
- Associations can only be assigned as a whole to a group and therefore, read-by-association and create-by-association must be implemented in the same class.
Further Information
- Development guide for the ABAP RESTful Application Programming Model, section Using Groups in Large Development Projects.