SAP CDS MEASURE DIMENSION APV



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS_DDL - Conceptual Background, Analytical Query
This topic explains some of the conceptual background of analytical data models.
ITOC

Analytical Cube View and Analytical Dimension View
The projected entity of a CDS analytical projection view must be an analytical cube view or an analytical dimension view. The fields of an analytical cube view and an analytical dimension view are interpreted as analytical measure fields and analytical dimension fields.
Analytical dimension field: Field that describes a characteristic or attribute and that can be used for grouping or filtering. For example if a view describes a sales order, the following columns can be dimension fields: customer, date, region. Dimension fields can have a foreign key association with a dimension view or a text view as association target. A dimension field must have one of the following data types: CHAR, NUMC, DATS , TIMS, INT1, INT2 , INT4, INT8, DATN, TIMN, UNIT, CUKY, LANG, CLNT, SSTR, RAW(16), UTCLONG.
Analytical measure field: Field that contains measurable data. In other words, an analytical measure can be any element that contains quantifiable data that can be calculated and aggregated, for example, the total price of all sales order positions. The aggregation behavior is defined via the annotation @Aggregation.default . Measures can have a reference to a unit key or currency key. The following data types are possible: DEC, CURR, QUAN , DECFLOAT16, DECFLOAT34, FLTP, DATS , DATN, TIMS, TIMN, INT1, INT2, INT4, INT8, DF16_DEC, DF34_DEC, DF16_RAW.

Analytical Query
The fields of a CDS analytical projection view can be classified into the following categories:
Analytical formula: Field of a CDS analytical projection view that is added in the projection layer as a new field. A formula can be an arithmetic expression, a currency conversion using the built-in function CURRENCY_CONVERSION, a unit conversion using the built-in function UNIT_CONVERSION, or a formula-related case expression . The annotation Aggregation.default: #FORMULA is mandatory.
Analytical selection: Field of a CDS analytical projection view that is newly added in the projection layer. A selection is defined by means of a selection-related case expression, also called restricted measure.
Dimension field: field of an analytical projection view that is defined as dimension field in the underlying projected entity .
Text fields and attributes relating to a dimension. Such fields are included via path expressions.
CDS amount fields, CDS quantity fields, currency key fields, and unit key fields.