Use Field-Based Modeling in Virtual Data Consumption Scenarios

Objective

After completing this lesson, you will be able to use field-based modeling in virtual data consumption scenarios

Case Study

Remember the requirements of Cathy related to transactional storage data.

Cathy's requirements: I want to analyze up-to-date quantities of all goods on stock in both companies. I want to store the information about stock quantities, for each product per stock bin and organizational unit, one snapshot for each week.

To meet the requirements, the following scenario is built.

Storage scenario.

The storage data of Retailer King is provided virtually from the source system T41 by an Open ODS View that is based on a BW DataSource. The BW DataSource is built on top of an ABAP CDS view. To provide the data from ItelO, an SAP HANA Calculation View is defined.

In our scenario, the Open ODS View is built on top of a BW DataSource. In this case, the association and activation of navigation attributes on the level of the Open ODS View are required to enable the activation of navigation attributes later in the CompositeProvider.

An Open ODS View can also be built on top of an SAP HANA table, view, or virtual table. In this case, the association and activation of navigation attributes on the level of the Open ODS View are not required to enable the activation of navigation attributes later in the CompositeProvider.

In the next step, a CompositeProvider is defined with a union on the Open ODS View and the SAP HANA Calculation View. The navigation attributes are set on the CompositeProvider.

Then, to persist weekly snapshots, the storage data is loaded from both sources.

ITelO wants to store the information about stock quantities for each product per stock bin and organizational unit, one snapshot for each week, for later reference, and to support future requirements.

Consider that more than one snapshot in a week can be drawn, but the final snapshot of a week is the relevant one.

There can be differences between the different snapshots of a week. Particularly, when a product is sorted out, a storno record is needed which, however, doesn't come from the source. It must be generated by a Standard DataStore Object (U##DWSTX2) for Delta Calculation with Snapshot Support.

Finally, a Data Mart DataStore Object (U##DMSTX2) is defined on top of the Standard DataStore Object (U##DWSTX2) and integrated in a CompositeProvider (U##V_ST_X2).

Field-Based Modeling with Open ODS Views

Source Types for Open ODS Views

The Open ODS view is a standard SAP BW/4HANA meta data object that provides a structure description with attributes (fields) and data types. It represents a view on a source and adds analytic meta data to this source. The Open ODS View does not have separate storage for transactional data or master data.

Using an Open ODS view, you can model master data attributes, texts, and transactional data. Hierarchies are not supported. Each Open ODS View is defined as being used for handling facts, master data, or texts.

The Open ODS view acts as an SAP BW/4HANA InfoProvider. It serves as a source for Queries and as such can be directly consumed by reporting clients. For reasons of flexibility and to be compliant with the LSA++ architecture, we recommend integrating each Open ODS view into CompositeProviders.

Let's have a look at the source types that are available for Open ODS Views.

Source Types for Open ODS Views.

As described earlier, the SAP HANA database consists of different database schemas each of which can represent a different application. There is the schema that is managed by SAP BW/4HANA, for example, in our course, SAPCIA. However, there may also be other schemas containing objects of other applications. All schemas besides the SAP BW/4HANA schema, are referred to as externally managed schema. Data from external databases can be replicated to externally managed SAP HANA schemas using replication tools, such as SAP system landscape transformation replication server (SLT), or Smart Data Integration (SDI). To integrate other database tables without duplicating data, tables can be connected using Smart Data Access from external databases.

The following key sources are available for Open ODS Views:

  • SAP HANA database tables, database views, or calculation views. They provide data managed by SAP HANA.
  • Virtual tables from external databases connected to SAP HANA using Smart Data Access.

The preceding figure explains the difference between the source types Database Table or View and Virtual Table via HANA Smart Data Access.

Use the first option, Database Table or View if you have an existing object (table, view, calculation view, or even virtual table) in SAP BW/4HANA's own SAP HANA database. For each schema, a source system of type HANA_LOCAL is required in SAP BW/4HANA. You can apply an existing one or generate a new one in the Open ODS View wizard.

Note that the second option, Virtual Table via HANA Smart Data Access, is only needed if you have not yet defined a virtual table on the database level. However, you need an existing smart data access connection on database level. Then, SAP BW/4HANA creates a new virtual table in the SAP BW/4HANA managed schema. For each remote source connection on SAP HANA level, a separate source system of type HANA_SDA is required in SAP BW/4HANA. You can apply an existing one or generate a new one in the Open ODS View wizard.

The following other source types can be used for Open ODS Views:

  • BW DataSources with enabled direct access for SAP BW/4HANA source system types ODP_SAP and SAP HANA.

  • Transformations
  • DataStore Objects (advanced)
  • Big Data source (Hadoop)

Virtual Data Marts Using Open ODS Views

Imagine that you want to know whether business users would use a new model. However, you want to avoid investing too much time in implementing a model. Then, you can provide reports to users, with some fields from the data source, or even from a remote data source in one easy step.

In this simple model, first, generate the master data Open ODS Views, then the fact Open ODS Views. You don't need to load data to SAP BW/4HANA in either case. Therefore, the model is called a Virtual Data Mart.

Virtual Data Marts.

As already described in this course, there are several advantages of separating master data from transactional data. One of these advantages is avoiding redundancy. The fact table can be restricted to the basic entities that determine the key figures, and all categories can be derived by a join to the master data table. This separation is often already realized in the source system, in a database, or in SAP HANA.

In this case, you can combine several Open ODS Views into a multidimensional star schema. The preceding figure explains the concept. The necessary design can be derived directly from the source system model, or from the logical data model of the business blueprint phase of your SAP BW/4HANA project.

For different types of data, define different types of Open ODS Views. The facts Open ODS View provides the key figures. Master data Open ODS Views provide attributes and texts. The connections for the star schema are defined as Associations in the central facts Open ODS View. These associations are rather modeled on the level of the CompositeProvider.

As an extra option, Master Data Open ODS Views can be associated with further Master Data Open ODS views.

The referenced data of the virtual data mart is usually stored outside SAP BW/4HANA, in different schemas. The data can even be stored in different external databases, as long as they can be connected as a remote source in SAP HANA.

From Virtual Data Mart to Physical Data Mart

From Virtual Data Mart to Physical Data Mart.

If the users like the idea but need more harmonization, a stable database, or faster data access, using a simple method to generate a data flow to a DataStore object (advanced). Then you can associate (link) more information from InfoObjects. The result is called a Physical Data Mart.

First priority: Virtual Data Mart (real time Access)

  1. Create an Open ODS View for Master Data with one Representative Key Field. Optionally, add compounded key fields = Characteristics (Key). Add Characteristics, maintain semantics (for example, Associations.)
  2. Create an Open ODS View for Facts. Maintain semantics (for example, Compounding, Currency/Unit Elements, Aggregation Behavior,, Associations, Navigation Attributes.)
  3. Include the Open ODS View for Facts in a CompositeProvider. Select fields and maintain semantics (for example, Associations, Navigation Attributes, Calculated Fields.)

Second priority: Physical Data Mart (Persist Data)

  1. From the Facts Open ODS View, choose Generate DataFlow to generate a DataSource. Make sure you have defined the correct key fields.
  2. Again, choose Generate DataFlow to generate a DataStore Object (advanced). Choose BW Data Types.
  3. Adjust the model type of the DataStore Object (advanced).
  4. Transformation and Full-DTP have been created as well. Adjust them if necessary.
  5. Load facts.
  6. In the CompositeProvider you can replace the Facts Open ODS View by the DataStore Objects (advanced), or still use the Open ODS View which now is based on the DataStore Object (advanced).
  7. Check the Associations and Navigation Attributes.

If loaded master data values must be used:

  1. From the Master Data Open ODS View, choose Generate DataFlow to generate a DataSource.
  2. Manually, create an InfoObject with the same key fields, compounds, and attributes.
  3. Manually, create transformation and DTP.
  4. In the CompositeProvider, switch to association with the InfoObject.

The association of certain fields in your Open ODS view with SAP BW/4HANA InfoObjects allows you to reuse valuable settings and master data that may exist in your SAP BW/4HANA InfoObjects.

Create an Open ODS View from a BW DataSource

Watch the video to see how to create an Open ODS View from a BW DataSource.

Create a CompositeProvider Containing Different Types of Views

Watch the video to see how to create a CompositeProvider containing different types of views.

Log in to track your progress & complete quizzes