Get Example source ABAP code based on a different SAP table
VERSION 5 IN
ABAP - RAP Business Objects This section of the ABAP keyword documentation describes the syntax and semantics of all language elements of ABAP RAP >. A RAP business object (RAP BO) is a business object (BO)> that plays a central role in ABAP RAP> by enabling transactional access to data that are described by ABAP CDS>. A business object is not a repository object, but it is made up from the following components and their relations. The RAP behavior definition plays a central role here in bringing the individual components together.
Data model The data modeling of a business object takes place using CDS entities that construct a CDS composition tree>, which is itself defined using CDS compositions> and to-parent associations>. The components of a tree-like hierarchy of this type are as follows:
RAP BO root entity>:
Each business object has exactly one root entity. A root entity is a CDS view>, a CDS custom entity>, or an CDS abstract entity> defined using the addition ROOT>. The root entity represents the business object. A root entity can have one or more child entities but cannot have a parent entity.
Child entity>
CDS compositions> can be used to define one or more child entities for each CDS entity of a business object. Before a CDS entity can be defined as a child entity, it must contain a to-parent association> with the parent entity and expose it.
Parent entity>
A CDS entity of a business object that uses CDS compositions> to define child entities is their parent entity. Each child entity can have exactly one parent entity and the syntax guarantees this by defining and exposing exactly one to-parent association > in each child entity.
Leaf entity>
A CDS entity of a business object that is not a parent entity or in which no child entities are defined using CDS compositions> is a leaf entity.
Behavior The RAP business object behavior> is defined in a RAP behavior definition> (BDEF). The BDEF defines the main characteristics of a RAP BO and which CRUD> operations or other actions it provides. There are two kinds of RAP BOs, managed and unmanaged:
For a managed RAP BO>, its behavior is fully or partly provided by the managed RAP BO provider.
For an unmanaged RAP BO>, its behavior must be fully provided by an ABAP behavior implementation>. The BDEF also defines the communication between the consumer and the provider of a RAP BO. This communication takes place by using internal tables of so-called BDEF derived types > that depend on the behavior definition:
The RAP BO provider> implements methods with parameters that are typed with BDEF derived types.
The RAP BO consumer> sends or receives internal tables of BDEF derived types to or from the RAP BO provider.
RAP business service A RAP business service provides access to CDS entities by Web clients from outside an AS ABAP. Such an access can be a pure read access (query) or a transactional request.
For read accesses (queries), all accesses from the AS ABAP to the underlying database are encapsulated by the RAP transactional engine>. Normally, no own ABAP programming is necessary. Only in exceptional cases, special CDS custom entities> can be used, that are implemented in ABAP classes.
For transactional requests, RAP business objects (RAP BOs) are required. In a RAP BO, a behavior is defined by a RAP behavior definition for a CDS entity, that can be exposed by a RAP business service. The behavior is implemented by the managed RAP BO provider or in ABAP behavior implementations. The main purpose of RAP BOs is to fulfill transactional OData requests from Web clients to the AS ABAP in accordance to the RESTful> paradigm. Besides that, accesses from ABAP programs to RAP BOs of the same AS ABAP are possible by using ABAP EML>. The following sections describe RAP business services>, the RAP behavior definition language (RAP BDL), and the ABAP statements for RAP. SUBNODES More information about ABAP RAP can be found under ABAP RESTful Programming Model> .