Blog > Smart Data Integration (SDI) – source data preparation

Smart Data Integration (SDI) – source data preparation

SDI_source_data_preparation_Sakalenka
Michał Krawczyk SAP Mentor, SAP Press Author
icon__calendar 2019-04-16

Introduction

SDI provides two data replication approaches. We can use them with the SAP HANA Web-based Development Workbench:

  1. Replication task (To replicate data from objects in a remote source into SAP HANA tables, you must configure the replication process by creating an .hdbreptask file, which opens a file specific to the Replication Editor.)
  2. Flowgraph is a graphical model of data flow which can include numerous objects such as:
  • Tables, views, and procedures from the SAP HANA catalog
  • Transformations such as projections, filters, unions, and joins
  • Functions from Application Framework Modeling (AFM).
  • Attribute views and calculation views, and so on.
  • Runtime behaviours

You should keep in mind that all created objects should be transportable into further systems. In the following blogs I will explain the process and dependencies in detail.

It is rather difficult to come across the same database data models in different systems. Usually we need to combine data from one data model to another and only after that put it into a target table.

S/4HANA system – tables

For demonstration purposes I have prepared a couple of tables in source S/4 HANA system and put some test data there. First table holding current status of a unique object:

SDI Test Table
Test Table for SDI

The second table carrying dummy flags of an object:

SDI Source Data Preparation Test Table
Smart Data Integration Source Data Preparation Test Table

First of all, in order to have all the objects in one place we should create a package.

SDI Package Creation

Next step is a HDB schema creation. In this case we just need to create and save a file with corresponding extension: .hdbschema.

HDBSchema Definition

As I already mentioned in my previous blog the direction of data replication is not so common and we are going to move data from S/4 HANA to ORACLE. We already created a remote source and virtual table as a target of a data flow.

Now we should prepare the source part. In order to access S/4 HANA ABAP table contents and use them in our custom schema we should create corresponding synonyms:

HDBSynonymus Creation

Based on synonyms we should create HDB views (file with extension .hdbview), which present data stored in the source tables. In order to make the process a little more complex in the first view we will split data which is stored in one field into four columns:

HDBView Definition

In the second .hdbview we will use WHERE clause to restrict selected data.

HDBView Definition

Note: In order to enable realtime replication we would have to create a Virtual Table on top of HANA SDI adapter. The virtual tables would point to the tables mentioned above. Field split and filtering would be incorporated into the flowgraph itself with the use of tools made available in the flowgraph toolset.

Now we have two data sets from different table synonyms. In the third view we will join them to have a final dataset for replication.

HDBView Definition

At this point source of data is ready. In order to check the data we have at the source side, just go to IDE-Catalog and select Open Content on each object you have created.

HWB Catalog Table Definition

SAP Hana Wed-base Development workbench is a powerful tool which allows you to combine, sort and filter data you want to replicate. You can see the data set which will be sent to target below:

HWB Catalog Table Content

In case you have any questions about SDI please feel free to comment under the blog.

PS.  SDI version used: 2.2.4 on HANA 1.0

Michał Krawczyk SAP Mentor, SAP Press Author
SAP integration consultant since 2004. He has been recognized by SAP included becoming an SAP Mentor in 2007 and winning the top contributor/topic leader award from SDN (SAP Developer Network portal) in SAP PO/PI eight times. Michal is the author many SAP integration related books: Mastering idoc business scenarios with SAP XI , Mastering idoc business scenarios with SAP PI (second edition).