9.3Digression: SAP Business Warehouse

Two questions that come up on a regular basis are as follows:

We’ll discuss these two questions in this section.

9.3.1SAP HANA Versus SAP Business Warehouse

In answer to the first question, SAP HANA does not replace SAP BW. Even though SAP HANA is more than just a database, it isn’t a data warehouse on its own.

However, some scenarios that were implemented using SAP BW in the past will be possible without this data warehouse in the future. Instead of setting up extraction, transformation, loading (ETL) processes for these scenarios, you’ll use the original data from the transactional systems (if SAP HANA is the primary database), or you’ll replicate the required data to a secondary SAP HANA database (i.e., you use SAP HANA as a data mart).

Other scenarios will still benefit from the capabilities of a data warehouse in the future. Using SAP BW (based on a traditional database or an SAP HANA database), you can do the following:

From our point of view, SAP HANA should be used instead of SAP BW in particular for operational reports and data analysis and, in some cases, for system landscapes where only a single transactional system is connected to the data warehouse today. For enterprise data warehousing at the tactical and strategic level, you should still use SAP BW (based on SAP HANA, if possible).

This takes us to the second question: Is it true that every AS ABAP has SAP BW functionality? The answer to that question is yes because every AS ABAP includes the SAP_BW software component as of Release 6.40. Therefore, every up-to-date ABAP system, including SAP ERP or SAP Customer Relationship Management (SAP CRM), includes the Analytic Engine from SAP BW. You can also use the SAP BW functionality in SAP ERP or SAP CRM (i.e., directly in the OLTP system). This way of using SAP BW is referred to as Embedded Reporting (as opposed to Enterprise Data Warehousing) and is especially suitable for operational reports and data analyses.

Using SAP BW can provide some benefits if you want to expand transactional applications through analytical functionality. These benefits are discussed in more detail in Section 9.4. Before we discuss those benefits, however, we want to explain some basic SAP BW terms and discuss how to access data in SAP HANA using InfoProviders.

9.3.2Overview of Terminology

To understand how you can access data in SAP HANA using InfoProviders, you must know some terms and concepts of SAP BW. If you’ve never worked with SAP BW, Figure 9.6 provides an overview of the most important concepts.

SAP Business Warehouse

Figure 9.6SAP Business Warehouse

InfoProviders are used for data access in SAP BW. The system differentiates between InfoProviders where data are actually loaded physically via ETL processes and InfoProviders that only provide a logical view of the data. Examples for InfoProviders are InfoCubes, ODS objects, InfoObjects, transient and virtual InfoProviders, and MultiProviders.

Put simply, InfoObjects can be subdivided into key figures (e.g., revenue) and characteristics (e.g., an airline). InfoObjects are used to model InfoProviders. However, characteristics can also be used as InfoProviders themselves (and usually provide access to master data in this case).

DataSources transfer data in SAP BW (e.g., from a transactional system such as SAP ERP).

Analytic queries (also referred to as SAP BW queries) describe data queries executed on InfoProviders. They define rows and columns, filters, threshold values (to highlight specific records), and so on. To define analytical queries, you use the SAP BEx Query Designer, which is part of the SAP BEx. Analytical queries are executed via the Analytic Engine, which supports reporting and multidimensional analyses.

SAP BEx provides reporting and analysis tools for SAP BW:

As an alternative to the SAP BEx Analyzer and the SAP BEx Web Application Designer, you can also use the tools provided by SAP BusinessObjects:

For further information on SAP BEx, go to http://scn.sap.com/community/business-explorer.

9.3.3InfoProviders When Using SAP HANA

This section explains how you can access data views in SAP HANA using transient and virtual InfoProviders. In addition to that, we’ll introduce further transient InfoProviders for accessing data on the SAP HANA database. We’ll then provide an example to describe how to use InfoProviders in SAP BW queries.

Transient InfoProviders Based on Views

Transient InfoProviders are generated based on a data source at runtime and without modeling in the Data Warehousing Workbench. This type of InfoProvider doesn’t contain any data. When accessing transient InfoProviders, the system reads the data from the underlying data source.

When using SAP HANA as a primary database, you can access SAP HANA views via transient InfoProviders. To do so, you must first publish the views. Suitable candidates are analytic views and calculation views (see Chapter 4, Section 4.4).

Use Transaction RSDD_HM_PUBLISH to publish SAP HANA views. This transaction creates an analytical index for an SAP HANA view and subsequently a transient InfoProvider @3<Name of the analytical index> based on this index. For an analytic view, the characteristics and key figures of the transient InfoProvider are derived from the fact table (data foundation) and the dimension tables (e.g., the linked attribute views).

Figure 9.7 shows the analytical index and the transient InfoProvider for the analytic view AN_FLIGHT.

Creating an Analytical Index

Figure 9.7Creating an Analytical Index

Optionally, you can assign InfoObjects defined in the Data Warehousing Workbench to the characteristics and key figures of the transient InfoProvider. You can thus add further metadata to the InfoProvider that can, for example, be used for authorization checks. It’s currently not possible to use the navigation attributes of the referenced InfoObjects.

The biggest advantage of a transient InfoProvider is that it’s regenerated at runtime by the system if necessary. This means that the InfoProvider and the SAP BW queries that are based on this provider are usually changed automatically if you modify the underlying analytic view or calculation view.

A disadvantage is that transient InfoProviders can’t be transported, so they must be created manually in every system (development, quality assurance, production).

Virtual InfoProviders Based on Views

Instead of working with a transient InfoProvider, you can also define a virtual InfoProvider. In contrast to transient InfoProviders, virtual InfoProviders are modeled in the Data Warehousing Workbench (Transaction RSA1). Like transient InfoProviders, virtual InfoProviders don’t contain any data. When accessing virtual InfoProviders, the system reads the data from the underlying data source. When using SAP HANA as a primary database, you can use virtual InfoProviders to access analytic and calculation views.

The example in Figure 9.8 shows how the AN_FLIGHT virtual InfoProvider is created.

If you want to access virtual master data when defining a virtual InfoProvider, you can use virtual InfoObjects. Like virtual InfoProviders, virtual InfoObjects are modeled in the Data Warehousing Workbench but don’t contain any data. When accessing virtual InfoObjects, the system reads the data from the underlying data source.

Creating a Virtual InfoProvider

Figure 9.8Creating a Virtual InfoProvider

When defining a virtual InfoObject, you can refer to an attribute view in the primary SAP HANA database. The example in Figure 9.9 shows how this is done using the InfoObject CARRID and the attribute view AT_AIRLINE.

Creating a Virtual InfoObject

Figure 9.9Creating a Virtual InfoObject

Virtual InfoProviders have several advantages over transient InfoProviders: they support navigation attributes, can be transported, and can be used in MultiProviders. A disadvantage is that virtual InfoProviders must be modeled in the Data Warehousing Workbench. If you modify the underlying analytic view or calculation view, you might also have to change the virtual InfoProvider. The effort is thus a little greater than in the case of a transient InfoProvider.

Other Transient InfoProviders

For the sake of completeness, note that there are further transient InfoProviders that are also available in traditional databases:

Long before developing SAP BW, SAP already provided the reporting tool SAP Query. In contrast to other reporting tools (e.g., Report Painter and drilldown reporting for Financial Accounting (FI) and Controlling (CO), or the LIS for purchasing and sales), SAP Query can be used universally.

Reports created with SAP Query (i.e., queries, which must not be confused with SAP BW queries) are based on classic InfoSets (not to be confused with the InfoSets in SAP BW). Classic InfoSets provide a view of certain data. The data sources used for classic InfoSets are often database tables or joins defined for several database tables. However, classic InfoSets can also be based on a logical database or on a data-retrieval program.

If you release a classic InfoSet for use via the Analytic Engine in Transaction SQ02, the system creates the @1<Name of the classic InfoSet> transient InfoProvider based on the classic InfoSet.

ODP is part of the infrastructure that is provided for Search and Operational Analytics as of AS ABAP Release 7.31. In the context of Enterprise Data Warehousing, DataSources (see Section 9.3.2) are used to load data from transactional systems in SAP BW.

The basic idea of ODP is to define a search-and-analysis model by linking and enhancing DataSources by analytical properties in the transactional system. You can then create an operational data provider based on this search-and-analysis model. This operational data provider is made available via a transient InfoProvider for operational reports and data analyses without having to perform an extraction to a data warehouse. Optionally, the data can be indexed in a secondary SAP HANA database or in the SAP BW Accelerator (BWA) based on the infrastructure of the ABAP AS.

Using the InfoProviders in SAP BW Queries

All InfoProviders described previously can be used when creating a SAP BW query. A SAP BW query describes a data query to an InfoProvider. SAP BW queries are defined using the SAP BEx Query Designer.

SAP BW Query Based on the AN_FLIGHT InfoProvider

Figure 9.10SAP BW Query Based on the AN_FLIGHT InfoProvider

The example in Figure 9.10 shows the SAP BW query AN_FLIGHT_QUERY1 (Payment sum per connection) that is based on the AN_FLIGHT transient InfoProvider. The SAP BW query describes a report that indicates the sales per flight connection. You can run a first test for your query in Transaction RSRT.