Get Example source ABAP code based on a different SAP table
ABAP_CDS_DDL - CDS Simple Type, data_element>
ABAP_SYNTAX ... data_element ...>
What does it do? A CDS simple type> can be typed using a DDIC data element> data_element>. data_element> can have any ABAP Dictionary type listed in the topic CDS Simple Type, dtype>>. ABAP Dictionary types which are not listed there, such as abap.fltp>, are not available in CDS types. The technical properties of a DDIC data element are inherited from the data element to the CDS simple type. This means that the data type, length, and decimal places are inherited. The following semantic DDIC properties are also inherited from a data element to a CDS simple type:
Conversion routine>
Lowercase letters>>
Change document>> The DDIC properties are translated into annotation values of a simple type. The following table shows a mapping from a DDIC property to a CDS simple type annotation: DDIC property> CDS simple type annotation> Conversion routine> AbapCatalog.typeSpec.conversionExit> > Lowercase letters> ObjectModel.upperCase>> Flag for change document> AbapCatalog.typeSpec.changeDocumentRelevant>> Field label, Heading> EndUserText.heading>> Field label, Medium> EndUserText.label>> Short text> EndUserText.quickInfo>> Details about these properties can be found in the following documentation: DDIC - Semantic Properties of Domains> and DDIC - Semantic Properties of Data Elements>. The properties that are inherited from a DDIC type can be overridden in the CDS simple type if necessary.
ABAP_RESTRICTIONS
Search helps> are not inherited. Search helps can be defined in CDS simple types using the annotation Consumption.valueHelpDefinition>.
The short label and long label of DDIC data elements have no corresponding annotation in CDS simple types. This information is not inherited.
The output length of a DDIC domain is not inherited. The output length is derived from the context, if necessary. ABAP_RESTR_END
ABAP_EXAMPLE_VX5 The following example shows how annotations are inherited from DDIC objects to CDS simple types.
The DDIC domain DEMO_BT_INHERITANCE>> has the following properties:
Data type CHAR1>, length 1
Output length 2
Conversion routine ALV1>
It is not case sensitive, so all letters are converted to uppercase.
The DDIC data element DEMO_BT_INHERITANCE>> inherits the technical properties from the domain. Additionally, it specifies field labels.
The CDS simple type DEMO_SIMPLE_TYPE_INHERITANCE>> is based on the data element DEMO_BT_INHERITANCE> and inherits its properties and texts: DRTY DEMO_SIMPLE_TYPE_INHERITANCE
The CDS view entity DEMO_CDS_BT> uses the CDS simple type DEMO_SIMPLE_TYPE_INHERITANCE> for a cast expression. As a result, the field Char1Field> inherits the properties and texts from the CDS simple type. DDLS DEMO_CDS_BT The system class CL_DD_DDL_ANNOTATION_SERVICE> evaluates the annotations of the field Char1Field>. ABEXA 01751 Result: The CDS simple type inherits the technical settings from the DDIC data element, converts them to annotation values, and passes them on when it is used in a CDS view entity. IMAGE bt.jpg 1152 152 ABAP_EXAMPLE_END