Using ABAP CDS Views Related to SAP BW/4HANA Context

Objectives

After completing this lesson, you will be able to:

  • Use ABAP CDS Views related to SAP BW/4HANA Context

ABAP CDS View Usage in an SAP BW/4HANA Context

Use Cases for ABAP CDS Views in an SAP BW/4HANA Context

In this section, we present some typical scenarios how SAP S/4HANA and SAP BW/4HANA can cooperate using ABAP CDS views.

To learn about use cases for ABAP CDS views in an SAP BW/4HANA context, refer to the following video.

Direct BW Query Access on Embedded BW (Transient Provider)

Query on Transient Provider

The ABAP CDS view has the annotation must have the annotation @Analytics.dataCatagory: #CUBE. Then a transient provider is created automatically.

A BW Query is defined on an InfoProvider, which is a transient provider in this scenario. When using a transient provider, the metadata in SAP BW/4HANA is not persisted, but generated at runtime. If the source metadata is changed, the transient provider is adapted automatically.

As prerequisite for this scenario, the ABAP CDS view must have the annotation @Analytics.dataCatagory: #CUBE. A transient provider is then created automatically.

Note

The annotation @Analytics.query:true is not required, nor does it generate a transient provider.

Instead of predefined InfoObjects, a transient provider offers transient objects, which are generated based on the fields of the ABAP CDS View.

If the ABAP CDS view has the annotation @AbapCatalog.SQLviewName: 'XYZ', then the name of the transient provider is 2CXYZ.

Use cases for this scenario are:

  • Use field based models in Embedded BW in SAP S/4HANA
  • Quickly leverage BW Query capabilities for ABAP CDS views in SAP S/4HANA

The following BW functionality is supported:

  • BW Variables (for fields with Semantic Annotations)
    Note
    As the Query is based on generated transient objects, and not on InfoObjects, the use of BW hierarchies and related variables is not supported.
    Note
    Parameters defined in the ABAP CDS view must be defined in the BW Query as static filter (as fixed value or as mandatory BW variable)
  • Restricted key figures.
  • Exceptions and conditions.
  • Currency conversion.
  • Report-to-report interface.
  • BW Query and InfoProvider authorization.
    Note
    Analysis authorizations are not supported, but SAP S/4HANA Analytics privileges are used.

When searching for a transient provider using the InfoProvider search of the New Query dialog, make sure that you select Search for transient provider.

Use the Name/Description field to find a transient provider.

Transactions RSRT and RSRTS_ODP_DIS can be used to find Transient Providers.

Recommendations

Consider the following when using Embedded BW in SAP S/4HANA:

  • It is not intended for building an Enterprise Data Warehouse.

  • It is only intended for SAP standard scenarios.

  • If you load/create data, keep Embedded BW data low (<20% of the SAP S/4HANA data volume.)

  • If different clients exist in SAP S/4HANA, use another dedicated Embedded BW client.

  • SAP S/4HANA authorizations do not apply for Embedded BW, but must be mapped and generated if necessary.

  • Transports: first transport the ABAP CDS View, then transport the queries.

Virtual Access in SAP BW/4HANA (Open ODS Views)

Virtual Access of ABAP CDS Views

Virtual Access and Modeling via Open ODS views.

In this scenario, ABAP CDS Views are consumed virtually in SAP BW/4HANA. The ABAP CDS View needs the following annotations:

  • @Analytics.dataExtraction.enabled:true
  • @Analytics.dataCatagory: #CUBE, @Analytics.dataCatagory: #FACT or @Analytics.dataCatagory: #DIMENSION.
    Note
    Not @Analytics.dataCatagory: #AGGREGATIONLEVEL

It requires a two-step approach:

  1. Define an OPD_CDS DataSource on the ABAP CDS view.
  2. Define an Open ODS View on the OPD_CDS DataSource.

Use cases for this scenario are:

  • Virtual (real-time) consumption of OLTP data in SAP BW/4HANA (Analytics CDS views, Interface CDS views.)
    Note
    An example is using a CompositeProvider to combine transactional data from SAP S/4HANA (using an Open ODS view) with historical data from SAP BW/4HANA, stored in a DataStore Object (advanced).
  • SAP BW/4HANA and SAP S/4HANA are deployed across different SAP HANA instances.

The following BW functionality is supported:

  • Modeling through Open ODS Views, utilizing semantic information.
  • BW Query functionality.
  • SAP BW/4HANA authorizations.
  • BW Hierarchies.

Recommendations

Consider the following when using ABAP CDS views for virtual access:

  • Distinguish between transactional data and master data and create associations accordingly.
  • Start with the Open ODS views for master data, then proceed with Open ODS views for transactional data.
  • The field SAP Client needs to be added to the key of all Open ODS views and needs to be uniquely filtered.
  • Use BW Query on top of Open ODS views or CompositeProviders to take advantage of the full set of reporting features.

ETL in SAP BW/4HANA (ODP in CDS Context)

Loading Data Using ABAP CDS Views

ABAP CDS Views in a Data Flow.

In this scenario, ABAP CDS views are used as a replacement for older SAP Extractors to load data to SAP BW/4HANA. The ABAP CDS View needs the following annotations:

  • @Analytics.dataExtraction.enabled:true
  • @Analytics.dataCatagory: #CUBE, @Analytics.dataCatagory: #FACT or @Analytics.dataCatagory: #DIMENSION.
    Note
    Not @Analytics.dataCatagory: #AGGREGATIONLEVEL

Use cases for this scenario are:

  • Load (and transform OLTP data) to SAP BW/4HANA (once, scheduled, near real-time.)
  • SAP BW/4HANA and SAP S/4HANA are deployed across different SAP HANA instances.

The following BW functionality is supported:

  • Combine transformation on source side (through the ABAP CDS view definition) with BW Transformation in SAP BW/4HANA.
  • BW Query functionality.
  • SAP BW/4HANA authorizations.
  • Extract with delta mechanism, determine deletions.
  • Combine transactional data from SAP S/4HANA Analytics with master data (InfoObjects) in SAP BW/4HANA.

Finding a Suitable CDS View

The question is how to find a CDS view that is enabled for extraction. If you know part of its name, you can simply start typing the name in the New DataSource dialogue.

How do you find a name of a suitable ABAP CDS View in the source system?

  • ABAP object search in ABAP perspective (ADT).
  • Package hierarchy (e. g. superpackage APPL, package VDM_SD).
  • Value help in transaction RSRTS_ODP_DIS.
  • Check content of view: I_DATAEXTRACTIONENABLEDVIEW (which lists all views that are available for extraction.)
  • SAP Help pages: https://help.sap.com/s4hana
  • View the Browser app in the SAP Fiori Launchpad.
Search for a suitable CDS view with a specific annotation.

An app called View Browser allows you to find suitable views for extraction.

Here is an image which displays the how you can use the View Browser with option search in (*) Table & column Names . For example, enter CSKT and choose sub-option Table Names , then choose Search button. The result in this cae is one View, I_CostCenterText.

Alternatively, you can search for entities that contain data from a specific table.

Log in to track your progress & complete quizzes