Ansicht
Dokumentation
ABENCDS_DEFINE_VIEW_ENTITY - CDS DEFINE VIEW ENTITY
PERFORM Short Reference General Material DataThis documentation is copyright by SAP AG.
- DEFINE VIEW ENTITY
$[@entity_annot1$]
$[@entity_annot2$]
...
$[@view_entity_annot1$]
$[@view_entity_annot2$]
...
$[DEFINE$] $[ROOT$] VIEW ENTITY view_entity
$[parameter_list$]
AS select_statement $[;$]...
Additions
1. ... ROOT ...
Effect
Defines a in the CDS DDL. A CDS view entity is implemented using a select_statement.
The name of the CDS view entity is defined after the DEFINE VIEW ENTITY statement. The usual rules for ABAP Dictionary views apply to this name and it is not case-sensitive (it is transformed internally into uppercase letters). It can have a maximum of 30 characters and is in the namespace of all global types of an AS ABAP. The name of the DDL source and of the CDS entity must be identical.
The CDS view entity can be enhanced with entity annotations (these are annotations that can be used in all CDS entities) or with view entity annotations (these are annotations that are only available for CDS view entities). All annotations are optional and a view entity can also be created without any annotation.
parameter_list can be used to assign input parameters to the view. These input parameters can be specified in operand positions of the view and can be assigned actual parameters when the view is used.
The addition ROOT is optional. It defines the CDS view entity as root entity of a RAP business object in the ABAP RESTful Application Programming Model. For further details, see topic CDS View Entity, Root.
Notes
- ABAP annotations can be used to assign further technical and semantic attributes to a view for evaluation by the ABAP runtime framework. Framework-specific annotations can be used to assign further semantic attributes to a view that are evaluated by other SAP frameworks.
- If a CDS role is defined for a CDS entity using the CDS-DCL statement DEFINE ROLE, implicit access control applies by default when the CDS entity is accessed using . CDS access control can be switched off using the value #NOT_ALLOWED for the annotation @AccessControl.authorizationCheck and using the addition WITH PRIVILEGED ACCESS in the FROM clause of an query.
- If a CDS entity is accessed using an SELECT statement and the name view_entity, the syntax check is performed instrict mode, which handles the statement more strictly than the regular syntax check.
- Every CDS view entity has its own DDL source code. The DDL source code of a CDS view entity is edited in a different editor than the DDLA source code of an annotation definition, the DDLX source code of a CDS metadata extension, and the DCL source code of a CDS role. The ADT documentation describes how the different types of source code are created. CDS source code can also be displayed in Repository Browser in ABAP Workbench.
- After a CDS view entity has been transported, its name can no longer be changed.
Example
The CDS view entity DEMO_SALES_CDS_BUPA_VE contains information about a business partner. It selects data from the database table DEMO_SALES_BUPA.
Fill RESBD Structure from EBP Component Structure CPI1466 during Backup
This documentation is copyright by SAP AG.
Length: 7629 Date: 20240419 Time: 204750 sap01-206 ( 84 ms )