Using SAP HANA as Source System

Objectives

After completing this lesson, you will be able to:

  • Describe how to use SAP HANA as Source System

SAP HANA Source System

Getting Started

One of the key areas for innovation in SAP BW/4HANA is the extended and simplified integration of external non-SAP data. To enable this, SAP BW/4HANA includes the technologies explained in the previous lesson, SAP HANA Smart Data Access (SDA) and SAP HANA Smart Data Integration (SDI) which play a significant role in the provisioning of data from non-SAP data sources.

Within these SAP HANA technologies, SAP BW/4HANA provides a new way to directly access, or to persist, the data coming from various sources into SAP BW/4HANA virtually, in batch mode, or real-time. To leverage the full advantages of SAP HANA, and to simplify and unify existing source systems, a new type of DataSource has been introduced. Under the new source system SAP HANA with its three subtypes:

  1. SAP HANA - Local Database Schema (HANA_LOCAL): Provides access to non-BW external schemas on the same SAP HANA database on which the SAP BW/4HANA application is deployed.
  2. SAP HANA - Smart Data Access (HANA_SDA): Leverages the customer-defined remote connections based on eitherSDA or SDI to access data on remote sources outside the local SAP HANA database.
  3. SAP HANA - Tenant Database Schema (HANA_MDC): Provides access to other schemas on other tenants on the SAP HANA database, in case of a multi-tenant deployment.The name of the source system subtype HANA_SDA might be misleading as it seems to refer to SAP HANA Smart Data Access only. This is due to historical reasons as SAP HANA Smart Data Access was the first and thus name-giving technology. In fact, both connection techniques are equally available here: SAP HANA Smart Data Access (SDA) and SAP HANA Smart Data Integration (SDI).

Comparing SAP NetWeaver BW 7.5 with SAP BW/4HANA

The SAP HANA source system types in SAP BW/4HANA replaces former SAP BW source systems DB Connect and UD Connect. SAP BW 7.5 connections set up as SAP HANA (HANADB)are mapped to the three successor SAP HANA source system types automatically during an in-place conversion.

BW Source System Type HANA_LOCAL (SAP HANA Local Database Schema)

This SAP BW/4HANA source system type provides access to other schemas on the same SAP HANA database where the SAP BW/4HANA application is deployed on.

To set this up, follow these steps:

In SAP BW/4HANA, first define a Source System of Type HANA_LOCAL:

Then define an Open ODS Viewreferring to a database table (see example below), a database view, a virtual table, or an XSC calculation view situated in a local data base schema.

Or define an Open ODS View referring to an XSA calculation view in an HDI Container.

In the case where data is to be loaded and transformed into master data bearing characteristic InfoObject or into DataStore Object (advanced), define a BW Data Source instead of an Open ODS View, either referring to a database table, a database view, a virtual table, or an XSC calculation view in a local data base schemaor referring to an XSA calculation view in an HDI Container.

Note

The BW DataSource can also be used for an Open ODS View to benefit from the potentially richer semantic of a BW DataSource compared to a DB table.

Scenarios for HANA_LOCAL:

BW Source System Type HANA_SDA (SAP HANA Smart Data Access)

The new source system type enables users to access SAP HANA SDI and SAP HANA SDA with a large number of delivered database drivers and adapters. The so-called SAP HANA federation framework, managed by the HANA Indexserver delegates SDA, requests to the corresponding ODBC driver or, in case you use an SDI adapter, to the SDI Adapter Framework in the EIM DP-Server. This way SAP BW/4HANA is enhanced with a new ability to leverage these interfaces from the native SAP HANA Platform, and connect to SAP HANA sources as well as many other databases and applications.

All SDA or SDI interfaces can be set up and maintained from the SAP BW/4HANA application in the standard way. This is based on BW Source Systems, BW DataSources, Transformations, DTPs, and data targets like Open ODS Views or Advanced DSOs. Not only do they enlarge the scope of the source data to be integrated into SAP BW. They also add real-time streaming options.

The process is the following:

  1. In SAP HANA: Set up the Remote Source connection either on an SDA driver or SDI adapter
  2. In SAP BW/4HANA: Create a New Source System of Connection Type: SAP HANA Smart Data Access referring to the Remote Source of step (1).
  3. InSAP BW/4HANA: Consume this remote source in either an Open ODS View for direct virtual access or define a BW DataSource and classical data flow on top of it (master data bearing characteristic InfoObject or DataStore Object (advanced), Transformation and DTP).
Note

The BW DataSource can also be used for an Open ODS View to benefit from the potentially richer semantic of a BW DataSource compared to a DB table.

Scenarios for HANA_SDA

Watch the following demos to learn about the different scenarios for HANA_SDA:

Explore Remote Sources

Watch the following demo to explore Remote Sources on the SAP HANA database of the SAP BW/4HANA system.

Create Source System of type HANA_SDA

Watch the following demo where a Source System of type HANA_SDA is created.

Create Open ODS View on source system of type HANA_SDA

Watch the following demo to understand how an Open ODS View on a source system of type HANA_SDA is created.

Create DataSource of source system type HANA_SDA and implement Remote Subscription

Watch the following demo where a DataSource of source system type HANA_SDA is created and Remote Subscription implemented.

For some SAP HANA SDI data provisioning adapters, real-time replication is supported. You can use remote subscriptions to replicate the data to the target table of the replication in real time, via the HANA_SDA source system. The data is available for updating to an ADSO based on process chains in streaming mode.

There are two types of remote subscription. They are as follows:

  1. UPSERT:

    Type UPSERT means that all types of data changes (inserts, updates, and deletions) are written to the target table with an UPSERT SQL command. For keys that have been deleted from the remote source object, the statement writes the value "D" to column SDI_CHANGE_TYPE in the target table. In other cases, the statement writes the value "A" to column SDI_CHANGE_TYPE to represent new and updated data records.

    The commit time stamp of the transaction is written to column SDI_CHANGE_TIME.

    This type of real-time replication allows delta extraction and data streaming from an SAP HANA DataSource based on the time stamps in column SDI_CHANGE_TIME.

  2. INSERT:

    Type INSERT means that all types of data changes (inserts, updates, and deletions) are written to the target table with an INSERT SQL command. The statement writes the original change type to the SDI_CHANGE_TYPE column. For each data change, a commit time stamp is written to the SDI_CHANGE_TIME column and a unique sequence number is written to the SDI_CHANGE_SEQUENCE column.

    Compared to the UPSERT type, not only after images (SDI_CHANGE_TYPE "U") but before images ("B") as well are recorded for each data change. This makes it possible to transfer the data changes to an InfoCube-like INSERT-only target (Data Mart ADSO).

There are three technical fields, which provide important metadata about the kind of change that is replicated. They are as follows:

  • CHANGE_TYPE

    Displays the type of row change in the source

    IINSERT
    BUPDATE (Before image)
    UUPDATE (After image)
    DDELETE
    AUPSERT
    RREPLACE
    TTRUNCATE
    XEXTERMINATE_ROW
  • CHANGE_TIME:

    Displays the time stamp of when the row was committed. All changes committed within the same transaction will have the same CHANGE_TIME.

  • CHANGE_SEQUENCE:

    Displays a value that indicates the order of operations for changes that were committed in the same transaction.

If the DataSource uses a data provisioning adapter that supports real-time replication, you can define which type or types of remote subscription should be used for real-time replication. You do this in DataSource maintenance on the Extraction tab. The selection depends on the required scenario.

Create Data Flow on HANA_SDA DataSource

In the following demo, a Data Flow on a HANA_SDA DataSource will be built.

Create Streaming Process Chain

In order to realize realtime replication, a Process Chain in Streaming Mode is created in the following demo.

Stream Data Changes

In the following demo, data changes in the source table are streamed into SAP BW/4HANA.

Log in to track your progress & complete quizzes