Syntax
... @annotation ...
Effect
Specifies Annotation annotation in the definition of a CDS view of the ABAP CDS before statement DEFINE VIEW. The character @ must be placed before the name annotation of the annotation. The table below shows the possible predefined annotations, which can be specified, and their meanings. All other annotations are user-defined annotations.
annotation | value | Default Value | Meaning |
AbapCatalog.buffering.status | #ACTIVE, #SWITCHED_OFF, #NOT_ALLOWED | #SWITCHED_OFF | SAP buffering active, allowed but not active, not allowed. |
AbapCatalog.buffering.type | #SINGLE, #GENERIC, #FULL, #NONE | #NONE | Buffering type: Single records, generic area, complete or no SAP buffering. |
AbapCatalog.buffering.numberOfKeyFields | Number between 0 and k-1 (k is the number of key elements) | 0 | Number of key elements for buffering generic areas |
AbapCatalog.compiler.compareFilter | true, false | false | If true, the filter conditions of the path expressions of the view are compared. If the same filter condition occurs, the associated join expression is only evaluated once. Otherwise a separate join expression is created and evaluated for each filter condition. |
AbapCatalog.sqlViewName | Character string, maximum 16 characters, which consists of letters, numbers and underscores and starts with a namespace prefix. | - | Mandatory. Name of the view in ABAP Dictionary. |
ClientDependent | true, false | true | true means that the CDS view is client-specific. When accessed using SELECT, automatic client handling is performed. |
DataAging.noAgingRestriction | true, false | false | false means that outdated data is not read. |
EndUserText.label | Character string with maximum 60 characters | - | Descriptive short text of the CDS view. |
The first column shows the annotation name annotation of predefined annotations, the second column shows the possible values value and the third column shows the value, which is implicitly set for value (if the annotation is not explicitly used). If nothing is specified for value, the annotation should be specified without a value.
Notes
- The definition of a CDS view for ABAP Dictionary must always contain the predefined annotation AbapCatalog.sqlViewName, which defines the name of the view in the ABAP repository.
- If a CDS view is configured to be not client-specific with the predefined annotation ClientDependent false, all CDS views that use this view as a data source are also not client-specific.
- Predefined annotations with multiple-part names, which are introduced with the same names, can be listed together in the relevant annotation list in curly brackets and have the same meaning; for example, @AbapCatalog.buffering:{ status:... type:... }.
Example
Additional properties with predefined annotations are defined for the CDS view business_partner (except for the mandatory @AbapCatalog.sqlViewName with the name BPA_VW for the ABAP repository). The short text Business partner and the CDS view is not client-specific.
- @AbapCatalog.sqlViewName: 'BPA_VW'
@EndUserText.label: 'Business partner'
@ClientDependent: false
define view business_partner as
select from snwd_bpa
{ key snwd_bpa.bp_id as id,
snwd_bpa.bp_role as role,
snwd_bpa.company_name,
snwd_bpa.phone_number }
Example
SAP buffering with single record buffering is activated for the CDS view business_partner.
- @AbapCatalog.sqlViewName: 'BPA_VW'
@AbapCatalog.buffering.status: #ACTIVE
@AbapCatalog.buffering.type: #SINGLE
define view business_partner as
select from snwd_bpa
{ key snwd_bpa.bp_id as id,
snwd_bpa.bp_role as role,
snwd_bpa.company_name,
snwd_bpa.phone_number }
Example
SAP buffering for a generic area and a key element is activated for the CDS view business_partner.
- @AbapCatalog.sqlViewName: 'BPA_VW'
@AbapCatalog.buffering.status: #ACTIVE
@AbapCatalog.buffering.type: #GENERIC
@AbapCatalog.buffering.numberOfKeyFields: 1
define view business_partner as
select from snwd_bpa
{ key snwd_bpa.bp_id as id,
snwd_bpa.bp_role as role,
snwd_bpa.company_name,
snwd_bpa.phone_number }
Example
For user-defined annotations, see the example under annotations.