A business object behavior definition (behavior definition for short) is an ABAP repository object (a source text artifact) that represents the behavior of the business object in the context of the ABAP RESTful Programming Model.
A behavior definition always references a CDS data model. The matching name of the CDS entity ensures that a behavior definition has a reference to the data model. This also means that the data model must always exist before the behavior definition, as shown in the following example:
The CDS definition define root view /DMO/I_Travel ... must exist before a behavior definition /DMO/I_Travel can be created. The CDS view /DMO/I_Travel is the root entity in the data structure.
Once the behavior definition is created, the root entity becomes a transactional entity and can, in principle, be used in modifying REST operations. All operations in the specific business object that have transactional support must be specified in this behavior definition.
The transactional behavior of a CDS entity is modeled using Behavior Definition Language (BDL).
7.31 | 7.40 | 7.54
- A root entity can have at most one behavior definition, in which the behavior of the child entities may need to be specified too. Conversely, a behavior definition has precisely one root entity.
- The implementation of a behavior definition can be made in both a single ABAP class (a behavior pool) or spread across any number of ABAP classes (behavior pools). This means that any number of behavior pools can be assigned to a behavior definition (a 1:n relation).