Ansicht
Dokumentation

ABENCDS_DEFINE_VIEW_AS_ANALYTICAL - CDS DEFINE VIEW AS ANALYTICAL

ABENCDS_DEFINE_VIEW_AS_ANALYTICAL - CDS DEFINE VIEW AS ANALYTICAL

ABAP Short Reference   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- DEFINE TRANSIENT VIEW ENTITY AS PROJECTION ON, Analytical Query

$[@entity_annot1$]
$[@entity_annot2$]
...
@AccessControl.authorizationCheck: #NOT_ALLOWED
$[@proj_view_annot1$]
...
DEFINE TRANSIENT VIEW ENTITY analytical_query
   PROVIDER CONTRACT ANALYTICAL_QUERY
   $[parameter_list$]
    AS PROJECTION ON cds_entity $[AS alias_name$]
      { element_list }
   $[WHERE cds_cond$]


Effect

Defines a CDS analytical projection view with the name analytical_query in CDS DDL. A CDS analytical projection view defines an analytical query in its element_list.

The projected entity cds_entity must be an analytical cube view. One cube view can serve as basis for multiple analytical projection views.

The name of the CDS analytical projection view analytical_query is defined after the DEFINE TRANSIENT VIEW ENTITY statement. It must comply with the naming rules for ABAP CDS with one specialization: It can have a maximum of 28 characters (instead of 30 characters), because the analytical engine automatically adds the prefix 2C during further processing.

  • The header annotation @AccessControl.authorizationCheck must be specified with the value #NOT_ALLOWED. Analytical queries can't be accessed using and therefore, no CDS access control can be specified. Instead, the CDS access control of the analytical cube view is taken into account.

Components

  • Header annotations specified before the statement DEFINE TRANSIENT VIEW ENTITY are not inherited from the projected entity. It is possible, but not mandatory, to specify entity annotations @entity_annot or projection view annotations @proj_view_annot as header annotations.
  • The mandatory keyword TRANSIENT defines a CDS analytical projection view as transient CDS view entity. That means that only a runtime object on the ABAP server is generated, but no SQL view is generated on the HANA database.
  • The provider contract must be specified with the value ANALYTICAL_QUERY to ensure that the appropriate features and syntax checks for analytical queries are applied.
  • parameter_list can be used to assign input parameters to the projection view. These input parameters can be specified in operand positions of the view and can be assigned actual parameters when the view is used.
  • The optional addition AS defines the name alias_name as alias name of the projected entity. The alias name can have a maximum of 30 characters. If no name is defined explicitly using AS, then the original name of the data source is used.
  • The element list element_list defines the components of the analytical query.
  • Optionally, the number of rows included in the result set can be further restricted by the addition WHERE.

Defining new associations in the projection layer is not possible.

Example

The following CDS analytical projection view DEMO_ANALYTICAL_QUERY defines an analytical query. It is based on the cube view DEMO_CDS_CUBE_VIEW.






Fill RESBD Structure from EBP Component Structure   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 7519 Date: 20240511 Time: 153846     sap01-206 ( 71 ms )