In the ABAP RESTful application programming model, a business object defines a particular entity, such as a travel agency. Its definition has two parts; one or more CDS views, which define the structure of the object or, in other words, the fields that it contains, and a behavior definition, which describes what you can do with the business object.

The behavior definition specifies which of the standard operations, create, update, delete are allowed. It can also contain the definition of validations, determinations, and actions. Validations check that the data is correct when you create or update a record. Determinations modify instances of business objects based on trigger conditions. Actions are non-standard operations which you use to provide customized, business-logic-specific behavior. Approving a purchase order or canceling a flight are activities that you would implement as an action.
The behavior implementation consists of one or more ABAP classes. Here the validations, determinations, and actions are implemented. When it comes to the standard operations, the model distinguishes two implementation scenarios: In the unmanaged implementation scenario, create, update, and delete are implemented in the behavior implementation. In the managed implementation scenario the runtime takes care of them.
Business objects are commonly used to provide the transactional logic for Fiori Elements apps or Web APIs. However, you can also access them from ABAP coding using the Entity Manipulation Language (EML). This is a set of ABAP statements that allows you to create, read, update, and delete data using business objects.
Note
EML is also able to access the application data from inside the behavior implementation of a business object.

In this unit, you will create a class that uses a business object to modify travel agency data. The view entity contains the key field AgencyID and various other fields containing information about the travel agency.
Behavior Definition and Implementation

There are two parts to the behavior of a business object: the behavior definition and the behavior implementation. The behavior definition contains information about what the business object can do, while the behavior implementation contains the actual coding that the system executes.
The behavior implementation is an ABAP class. You declare the class in the behavior definition in the statement managed implementation in class <class> unique. The actual coding of the behavior implementation is contained in a local class within the global class that you specify.

A behavior definition is an essential component of a business object. It describes which of the standard operations are allowed, for example create, update, delete. It also defines checks (validations) that are performed when you create or change data.
The example here is the behavior definition for the travel agency. At the beginning of the definition, you can see the name of the CDS view we just looked at, and that there is an alias defined for it. This is important, since it is the alias name that you use to address the entity using EML.
The behavior definition also links the CDS entity to the database table in which the data is stored. In this case, the business object uses two tables: one for active data and one for drafts (data that is incomplete and has not been checked). There is also information that is relevant for locking the data, authorization checks, and concurrency control. We are not going to look at this information in depth - you just need to know that the runtime can take care of these issues. You can also generate CDS entities and behavior definitions based on the definition of a database table and, in this case, locking, authorization checks, and concurrency controls are dealt with automatically.

The global class of the behavior implementation (also known as a behavior pool) is just an empty class definition with the special addition FOR BEHAVIOR OF followed by the name of the behavior definition. The actual implementation of the behavior definition is a local class within the global class definition. You access the class by clicking the Local Types tab.
The behavior implementation contains code that is specific to the business object, for example, the implementation for validations, determinations, and actions. Whether it also contains code for the standard operations (create, update, delete, and lock) depends on the details of the behavior definition. The behavior implementation for our business object does not contain code for the standard operations. This is because the business object uses the managed implementation type in which the runtime deals with the standard operations.

A validation is a check that the runtime performs when data is changed. Here, the validation is always performed when a new record is created (trigger create;) If an existing record is changed, the validation is only performed if the Name field has been changed (trigger field Name;).
Validations are defined in the behavior definition. For each validation, there is a corresponding method in the behavior implementation.