Get Example source ABAP code based on a different SAP table
• IMPLEMENTATION IN CLASS ABAP_BDL • UNIQUE ABAP_BDL
ABAP_RAP - implementation in class unique>
ABAP_SYNTAX ... implementation in class ClassName unique>
What does it do? Specifies an ABAP behavior pool> for the RAP business object>.
In a managed RAP BO>, a behavior pool is not necessarily required. Standard operations> and operations for associations > work without implementation in a behavior pool. A behavior pool is only required if the behavior definition contains components that cannot be handled by the managed RAP BO provider> , such as nonstandard operations> or validations>.
In an unmanaged RAP BO >, an ABAP behavior pool is always required.
In a projection behavior definition>, an ABAP behavior pool is not necessary, but possible:
functionality that is reused> from the projected BO> does not require its own implementation. The implementation from the projected BO is reused.
if the projection BDEF defines new actions or functions>, an ABAP behavior pool is required. There exist different options for notation that define how the implementation is distributed:
The behavior pool can be defined in the RAP behavior definition header>. In this case, all implementation-relevant parts of all RAP BO entities> that do not have an own implementation class are implemented in the same class. Further behavior pools on entity-level are possible.
The behavior pool can be defined in the entity behavior definition> for each CDS entity. Each node of a RAP business object > can have an own implementation class. If there is an additional implementation on header level, this applies to all entities which do not have their own implementation class.
The behavior pool can be defined within the entity behavior body> for one or more implementation groups >. Each group must have an own implementation class, while entities must not have an implementation class. An additional implementation class on header level is possible. The behavior for a certain entity or group can only be implemented in the specified behavior pool. Any other class that attempts this will get an error message. The mandatory addition unique> defines that each operation can be implemented exactly once.
Latest notes: If BDEF strict mode> is enabled, it is mandatory to specify an ABAP behavior pool as soon as there are any implementation-relevant operations (an exception is a managed BDEF that contains, for example, only standard CRUD operations>). The addition unique> is also mandatory and leads to a syntax check error if left out. NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLE_VX5 Behavior definition with behavior pool on header level: managed implementation in class ClassName unique; define behavior for CDSEntityName alias AliasName ...> Behavior definition with behavior pool on entity level: managed; define behavior for CDSEntityName alias AliasName implementation in class ClassName unique; ...> Behavior definition with implementation groups. Each group has its own implementation class. An implementation class on header level is required to implement the unmanaged save >. managed implementation in class ClassName unique; define behavior for CDSEntityName alias AliasName with unmanaged save { group one implementation in class Class1 unique { ... } group two implementation in class Class2 unique { ... } ... } ...> ABAP_EXAMPLE_END