What does it do? The RAP behavior definition header> of a projection BDEF> is similar to the header of a managed or unmanaged BDEF. It can project certain elements from its base BO. Some elements are also newly defined. All possible elements are listed below. The implementation type is mandatory and all other attributes are optional.
implementation type>: a projection BDEF must start with the keyword projection> and it must be based on a CDS projection view>.
implementation in class ClassName unique>>: in a projection behavior definition, an ABAP behavior pool> is not compulsory 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.
strict$[(version)$]>>: BDEF strict mode> can be used. As a prerequisite, it must be specified in the projected BO. The projected BO and the projection must use the same version of strict mode.
extensible>>: if specified, BDEF extensions> are allowed. As a prerequisite, BDEF strict mode> must be switched on. In projection BDEFs, only the keyword extensible> is possible, without the additions described in topic extensible>>.
use draft>>: the draft concept> can be reused from the base BO.
For details on the draft concept, see topic TITLE >.
For details on the reuse, see topic TITLE >.
with privileged mode disabling base context> >: BDEF privileged mode can be used. As a prerequisite, it must be specified in the projected BO. For details, see topic TITLE >.
foreign entity>>: Defines an entity which is not part of the BO structure as component for the response structures, thus enabling message mapping for other BOs. The behavior definition header is followed by
either the entity behavior definition > that starts with define behavior for>
or by the definition of an authorization context> that starts with define $[own$] authorization context>>.
ABAP_EXAMPLE_VX5 The following example shows a projection BDEF based on the projected BO DEMO_SALES_CDS_BUPA_2 >>. It defines the managed BDEF DEMO_CDS_VALIDATION>> as foreign entity and exposes the standard operations and associations of the underlying BO. ABAP_NOTE This example does not fully meet the requirements of the RAP BO contract>. It is intentionally kept short and simple and serves demonstration purposes only. See more information on the RAP BO contract in the Development guide for the ABAP RESTful Application Programming Model>. BDEF DEMO_RAP_PROJECTION_1 Like in a RAP BO of type managed or unmanaged, the foreign entity is included in the reported> structure: IMAGE foreign_in_projection.jpg 221 94 ABAP_EXAMPLE_END