BW InfoObjects modeled by CDS Views
Similar to BW, InfoObject in CDS could be:
- Key figures / measures:
- Fields defined with annotation @DefaultAggregation: #SUM, #MIN or #MAX or @Aggregation.default: #SUM, #MIN, #MAX or #NOP,.
- Usually they are directly defined in a "@Analytics.dataCategory: #CUBE" CDS views.
- If it is defined in a "@Analytics.dataCategory: #DIMENSION" CDS views, it is a key figure attribute of the InfoObject.
- By using @Aggregation.default: #NOP, key figure can have default aggregation NO2.
- Don't define @Aggregation.default(or @DefaultAggregation): NULL.
- Characteristics:
- All other fields, either without any @DefaultAggregation/@Aggregation.default annotation, or with @DefaultAggregation:#NONE.
- If the data type of the field is a key figure type, such as CURR, QUAN, DEC, FLTP..., it is not supported for a characteristic. In this case, the field is simply ignored before Note 2771186 and 2778887. After the two notes, the field gets a default NO2 aggregation and becomes a NO2 key figure. Explicit set @Aggregation.default:#NOP is not recommended as it is not supported in SADL service. Thus please just remove the @DefaultAggregation/@Aggregation.default annotation. Don't define the field with @Aggregation.default: #NONE or @Aggregation.default: NULL.
- Long timestamp (data type TIMESTAMPL) field is not supported. The field is ignored. (Note 2737769, 2887459 ).
- Fields longer than 250 characters are only considered up to the first 250 charaters. See Note 2852065.
- When data type INT* field is defined as characteristic, internally it is treated as NUMC data type, therefore only non-negative values are allowed. If negative number is needed for this field, please model it as a key figure. After Note 3072158 and 3091369 , CDS view parameter of type abap.int2,abap.int4 or abap.int8 supports negative values, the parameter is used as a formula variable.
SAP Online Documentation
DefaultAggregation Annotations
Characteristics
Features:
- Compounding in CDS
- Time characteristics
- Value help
- Language dependent Labels
- Reference characteristics
Key Figures
- Only support default aggregation: SUM, MIN, MAX, NOP.
- To use other aggregation such as AVG, please use formula exception aggregation in a CDS query.
- Semantics needs to be defined for amount or quantity key figures
- In a CDS query, key figure can't be used in CASE statement when clause as a condition when a Restricted Key Figure is defined. Because filtering on a key figure is not supported in Analytic Engine. Please define a formula (if operator) with case statement instead.
- In a dimension CDS view ( with annotation @Analytics.dataCategory: #DIMENSION), no key figure fields can be defined as key fields. Only characteristic fields can be key fields.
Examples:
Simple CDS Query with Exception Aggregation AVG
Amount and Quantity Key Figures