Page tree
Skip to end of metadata
Go to start of metadata

In the following we discuss how master data texts can be maintained for CDS dimensions (used in CDS queries). See also

Modeling Rule

  1. In the Dimension CDS view (with @ObjectModel.dataCategory: #DIMENSION), use @Semantics.text: true to define the text field. In the same view, use @ObjectModel.text.element to specify the default text field (displayed in query) for a key field.
  2. A Text CDS view is defined with @ObjectModel.dataCategory: #TEXT and can be associated with the corresponding dimension.
  3. Language and time dependent texts are only possible when a Text CDS view (defined with @ObjectModel.dataCategory: #TEXT) is associated with a Dimension view.  In the simplified 'inline text model' in a Dimension view only language and time independent text is possible.
  4. Use @AnalyticsDetails.query.display to specify whether key and/or text is displayed in a CDS query.
  5. The default text can be controlled by annotation @ObjectModel.text.element in a Dimension view. A list of fields can be specified in this annotation. The first one is the default text field.
  6. Annotation @Semantics.text: true can be used to define multiple text fields. The one with the longest field length is generated as the long text, the second long one (if any) is the medium text, the shortest one (if any) is the short text. Analytic Engine only supports short text with length <= 20, medium text with length > 21 and <= 40, long text with length >40 (in ABAP up to 1300 characters are possible, see Long, Medium and Short Text for details). If the text length is longer than a limit, the text is truncated.
  7. Further details to a text view (defined with @ObjectModel.dataCategory: #TEXT):
    1. Use @Semantics.language: true to define language key. The text CDS view has to provide only one text record for all individual master data values for a given language (and a given date), so it should contain unique values. This means that there must not be multiple text records for the same master data value.
    2. Use @Semantics.businessDate.from and define time dependent texts. One of them should be a key field of the text table (usually the field). The time dependent text CDS view needs to contain a unique value for any given time spot. That is, there are no multiple text records for the same master data value for any given time.
    3. In the Dimension CDS view (with @ObjectModel.dataCategory: #DIMENSION), use @ObjectModel.text.association to associate the text to the master data.
    4. When there are three text fields (annotation @Semantics.text: true), the longest field is generated as the long text, the second one is generated as the medium text, the shortest one is the short text.
    5. When there are two text fields, the longer one is generated as the long text, the shorter one is the medium text.
    6. When there is one text field, it is generated as the long text.
    7. By default, the shortest text is displayed in query result.

If the rules of points 7a/7b are broken, the following may be observed:

  • A query build on CDS model may get unexpected key figure multiplication when drill down some attribute text. The reason is similar to the effects explained in Ambiguous Join. Unique text is a fundamental pre-requisite for CDS modeling.
  • In the query result output, one of the text records is shown as the text, which may not be the one as expected.


  • No labels