SAP CDS SIMPLE TYPES



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS - Simple Types
A CDS simple type is a CDS type in ABAP CDS that defines an elementary data type. A CDS simple type can be enriched with metadata using CDS annotations. CDS simple types are defined with the following special CDS DDL statement in ADT:
SUBNODES
CDS simple types can be used for typing in the following contexts:
In ABAP CDS, simple types can be used for typing of elements or parameters or in cast expressions. The methods of the class CL_DD_SOBJECT_FACTORY handle CDS simple types and evaluate fields typed with reference to a simple type.
In ABAP, a simple type can be specified after the addition TYPE . The properties of the type can be evaluated using RTTI.
When used for typing, simple types pass their metadata defined by CDS annotations. In addition, simple types can be nested, providing extended reuse capabilities compared to DDIC data elements and DDIC domains.
A CDS simple type cannot be used as a data type in ABAP Dictionary. For example, it cannot be used to type DDIC data elements or DDIC views.
Frameworks:
CDS types are specifically designed for the ABAP RESTful Application Programming Model. They support metadata for OData and SAP Fiori-based scenarios.
CDS types are supported by analytical runtimes such as the ABAP Analytical Engine.
The annotations of a CDS type can be evaluated using the methods of the class CL_DD_DDL_ANNOTATION_SERVICE.
CDS simple types can be released as stable APIs under the following release contracts:
C1 contract, system internal use
C2 contract, use as remote API

ABAP_FURTHER_INFO
ABAP Data Models development guide, section about CDS simple types.



Latest notes:

The source code of simple types has its own editor in ADT, which is documented there.
CDS metadata extensions are not supported for CDS simple types. If required, metadata extensions can be added to a CDS simple type when the simple type is used in another CDS object, such as a CDS view entity.
CDS simple types are a successor of DDIC domains and DDIC data elements. They are mainly intended for use within frameworks such as the ABAP RESTful Application Programming Model . They support metadata for OData and SAP Fiori-based scenarios.
NON_V5_HINTS
There is, on the other hand, only rudimentary support for SAP GUI and dynpros .
ABAP_HINT_END
BEGIN_SECTION SAP_INTERNAL_HINT
The TADIR key for a CDS simple type is <(>R3TR DRTY<)>. DRTY is an abbreviation for Dictionary Reusable Type.
END_SECTION SAP_INTERNAL_HINT