This post talks about some of the unexplored and newer features within Core Data Services – CDS Simple Types. This is available from ABAP version 7.58

CDS Simple Type

CDS simple type is like a data element in the CDS world that refers to ABAP built-in types. Let us create one to understand more.

Provide Name and Description, click next and provide a TR, then click Finish.

Here, we are defining the simple type ZJP_SIMPLE_TYPE. The actual type for this is provided after the colon ( : ). You can use Ctrl + Space shortcut to get the suggestions.

The Type can also be enhanced with more annotations.

@EndUserText.heading: 'Sample Heading'
@EndUserText.label: 'Demo Simple Type'
@EndUserText.quickInfo: 'Sample QuickInfo' 
define type ZJP_SIMPLE_TYPE: abap.char( 10 );

These Simple Types can be used to define other simple types or for defining fields and parameters in CDS.

Defining CDS Simple Type with reference to another CDS Simple Type

Defining CDS field or parameter with reference to another CDS Simple Type

Use of CDS Simple Type for field reference.

Use of CDS Simple Type for parameter reference.

AbapCatalog Annotations

CDS Simple Type can be enhanced with annotations to specify whether the type is relevant for change documents or to define Conversion Exit. Conversion Exit will be evaluated by OData Framework and the usage within a service will be covered in a different blog post.

ObjectModel Annotations

ObjectModel.upperCase annotation is available. The default value is false, but it can be enabled using value true. True would mean that the output of this CDS simple type is all uppercase letters. This is only applicable if the type defined is a character type. Current BTP ABAP Cloud trial instance does not support this feature.

The CDS Simple Types can be used instead of creating data elements to define the custom entities and parameters.

Visit ABAP on HANA series for Tutorials on CDS, AMDP, Eclipse, and ALV IDA.


If you like the content, please subscribe…

Join 4,032 other subscribers

Discovering ABAP YouTube Channel