Post

Semantics Value Range in CDS

Learn how to use the @Semantics.valueRange annotation in CDS to define minimum and maximum value constraints for CDS elements.

Semantics Value Range in CDS

Annotation: Semantics.valueRange

You can use this annotation to inform consumers about the value range of a CDS element, allowing to specify minimal and/or maximal values and indicate whether these are exclusive or inclusive. The annotation can be applied to all fully ordered data types, i.e. Characters, Strings, Numbers, or Data Types. ```abap annotate view ZCRootEntity with { … @Semantics.valueRange.minimum: ‘20260101’ @Semantics.valueRange.maximum: ‘20261231’ BeginDate;

@Semantics.valueRange.minimum: ‘0’ @Semantics.valueRange.maximum: ‘100’ BookingFee;

} ```

This post is licensed under CC BY 4.0 by the author.