Ansicht
Dokumentation

ABENCDS_SEMANTICS_ANNOTATION_ABEXA - CDS SEMANTICS ANNOTATION ABEXA

ABENCDS_SEMANTICS_ANNOTATION_ABEXA - CDS SEMANTICS ANNOTATION ABEXA

BAL_S_LOG - Application Log: Log header data   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

, Evaluation of Annotations

This example demonstrates how semantics annotations of DDL source code are evaluated.

Source Code

Execute

Description

This program uses a simple example to show how annotations can be evaluated in a framework. All rows in a CDS entity are to be found that do not contain a fully specified address. Here, a fully specified address is simply a set of elements for name, street, city, postal code, and country, none of which can be empty.

To do this, the program uses cl_dd_ddl_annotation_service=>get_drct_annos_4_entity_elmnts to read the element annotations of a CDS entity and gets the names of the elements defined (using semantics annotations) as the required components of an address in the internal table address_components. In the next step, the CDS entity is read using SELECT and a dynamic ASSIGN statement is used to check whether all required elements have a non-initial value for each read row. The output consists of any rows that do not contain a full address.

The following CDS view is used as an example for a CDS entity:

This view wraps the DDIC database table SCUSTOM, which contains address data. The assignment of the semantics annotations to the columns of the DDIC database table gives the columns semantics that can be evaluated. Previously, this was only provided by those names and DDIC data elements that are no longer relevant for the evaluation depicted here.






CL_GUI_FRONTEND_SERVICES - Frontend Services   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 2208 Date: 20240425 Time: 172517     sap01-206 ( 41 ms )