Get Example source ABAP code based on a different SAP table
• GROUP ABAP_BDL_BODY
ABAP_RAP - Implementation Grouping
ABAP_SYNTAX ... group Group1 implementation in class Class1 unique> { // implementation-relevant content }
group Group2 implementation in class Class2 unique> { //implementation-relevant content }
$[group Group3 ...$] ...>
What does it do? 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>, and delete>.
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>, and delete> 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.
ABAP_AVAILABILITY
Managed RAP BOs>
Unmanaged RAP BOs> ABAP_AVAILABILITY_END
ABAP_FURTHER_INFO
Development guide for the ABAP RESTful Application Programming Model, section Using Groups in Large Development Projects>.
ABAP_EXAMPLE_VX5 - Managed The following example shows a managed BDEF that consists of a parent and of a child entity. The implementation is split into multiple groups. Each group has its own ABAP behavior pool. Group one_a> and one_b > share the same ABAP behavior pool. ABAP_NOTE This example is intentionally kept short and simple and serves demonstration purposes only. It does not fully meet the requirements of the RAP BO contract> and it does not implement the RAP handler methods> in the ABAP behavior pool>. BDEF DEMO_RAP_MANAGED_GROUP ABAP_EXAMPLE_END
ABAP_EXAMPLE_VX5 - Unmanaged The following example shows an unmanaged BDEF that consists of a parent and of a child entity. The implementation is split into multiple groups. Each group has its own ABAP behavior pool. ABAP_NOTE This example is intentionally kept short and simple and serves demonstration purposes only. The RAP handler methods> in the ABAP behavior pool> are not implemented here. BDEF DEMO_RAP_UNMANAGED_GROUP ABAP_EXAMPLE_END