Ansicht
Dokumentation

ABENCDS_F1_ELEMENT_ANNOTATIONS - CDS F1 ELEMENT ANNOTATIONS

ABENCDS_F1_ELEMENT_ANNOTATIONS - CDS F1 ELEMENT ANNOTATIONS

CL_GUI_FRONTEND_SERVICES - Frontend Services   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

- SELECT, element_annot

... @annotation ...
... @annotation ...

Effect

Specifies an annotation annotation in the definition of an element of a SELECT list in a CDS view as element annotation. Element annotations can be specified 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 elements of CDS entities can be assigned to the element annotations grouped under element_annot.

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.

@AbapCatalog.sqlViewName: 'CORP_SO_VW'
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

This example demonstrates inheritance of the element annotations in publications of CDS associations. The following CDS view defines and exposes a CDS association _some_assoc:

A further CDS view accesses the view and also exposes the CDS association. Here, the annotation @SomeAnno is inherited.

In the following CDS view, on the other hand, the dedicated CDS association _some_assoc is exposed and the annotation is not inherited.

If the CDS association _some_assoc were exposed from Demo_Cds_Assoc_Anno2 instead of or in addition to _some_assoc by specifying the name Demo_Cds_Assoc_Anno2._some_assoc explicitly, the annotation would be inherited again. The program DEMO_CDS_ASSOC_ANNO evaluates the annotations of both views. No local element annotations are defined for the locally defined association _some_assoc of the view Demo_Cds_Assoc_Anno1_Loc, which means that the result for this CDS association is empty.






General Material Data   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 6322 Date: 20240510 Time: 030950     sap01-206 ( 58 ms )