ABAP Keyword Documentation → ABAP Dictionary → ABAP CDS in ABAP Dictionary → ABAP CDS - Views → ABAP CDS - DDL Statements → ABAP CDS - DEFINE VIEW → ABAP CDS - SELECT → ABAP CDS - SELECT, select_list → ABAP CDS - SELECT, element
ABAP CDS - element_annot
Other versions:
7.31 | 7.40 | 7.54
Syntax
... @annotation ...
... @<annotation ...
Effect
Specifies an annotation annotation in the definition of an element of a SELECT list in a CDS view in ABAP CDS. Annotations can be listed before and after the element.
- In front of the element, the character @ must be placed before the name annotation of the annotation.
- Following the element, the characters @< 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 | Meaning |
---|---|---|
EndUserText.label | Character string with maximum 60 characters | Short text describing the element |
EndUserText.quickInfo | Character string | Tooltip of the element |
Semantics.amount.currencyCode | Name of an element defined as a currency key | Element is defined as a currency field to which a currency key is assigned |
Semantics.currencyCode | - | Element is defined as a currency key. |
Semantics.quantity.unitOfMeasure | Name of an element defined as a unit of measurement key | Element is defined as a quantity field to which a unit of measurement key is assigned |
Semantics.unitOfMeasure | - | Element is defined as a unit of measurement key |
The first column shows the name of the predefined annotations annotation and the second column shows the possible values value. If nothing is specified for value, the annotation should be specified without a value.
Example
In the CDS view corporation_sales_order, a short text and a tooltip are assigned to the element role. The element currency_code is flagged as a currency key and is assigned as a currency key to the element gross_amount.
define view corporation_sales_order as
select from snwd_bpa as business_partner
inner join snwd_so as sales_order
on business_partner.node_key = sales_order.buyer_guid
{ key sales_order.so_id as sales_order_id,
business_partner.bp_id as corporation_id,
business_partner.company_name,
@EndUserText.label: 'Corporation Role'
@EndUserText.quickInfo: 'Customer or supplier'
business_partner.bp_role as role,
@Semantics.currencyCode
sales_order.currency_code,
@Semantics.amount.currencyCode: 'currency_code'
sales_order.gross_amount }
where business_partner.legal_form = 'Inc.'; //Corporations only
Example
For user-defined annotations, see the example under annotations.