Define a Replication Flow

Objective

After completing this lesson, you will be able to create a replication flow to read sales order.

Contents

  • Verify HANA CLOUD Source Connection
  • Create a Replication Flow
  • Select Source Objects
  • Define Target Objects
  • Deploy and Run the Replication Flow
  • Monitor the Replication Task


In this lesson, we will import two tables stored in SAP HANA Cloud. The tables contain data about sales orders and sales order items. As part of the import, we will create a replication flow to copy the table structures and data from the external source into our user space.

Review the Help Portal for more information about Creating a Replication Flow.

Verify HANA Cloud Source Connection

The Sales Orders and Sales Order Items data objects are stored in SAP HANA Cloud, which we want to replicate. First, we test the existing connection to the source system.

  1. Select Connections (step ‘A’) in the side navigation area and your space if necessary. Your workshop space name corresponds to your username.

  2. An overview of connections to SAP and non-SAP sources are listed. These connections are tied to your user space.

  3. Select the connection HANA_CLOUD (step ‘B’) and choose Validate (step ‘C’).

  4. A message (step ‘D’) appears informing you about the availability of supported features, and provides details in case of errors in the connection.

Create a Replication Flow

Replication Flow supports the loading of multiple data assets from one source into a single target in a fast and easy way. Possible data sources are for example, SAP HANA, SAP HANA Cloud, or SAP S/4HANA.

We want to import both objects into our SAP Datasphere user space, leveraging the Replication Flow procedure.

  1. Select Data Builder in the side navigation area. Choose your space if necessary.

  2. Select the New Replication Flow tile to open the editor.

The replication flow editor opens with the properties side panel on the right. When you select a source or target object, the side panel properties change accordingly.

Select Source Objects

  1. Select Select Source Connection - Step ‘A’.

  2. Choose HANA_CLOUD in the list of available source connections.

  3. Select Select Source Container - Step ‘B’.

  4. Choose the DSP_DEMO container and press the Select button

  1. Next select Add Source Objects - Step ‘C’.

  2. Search for ‘4OV_SalesOrder’, select below tables and press the Next button.

    • 4OV_SalesOrderItems - Sales Order Items
    • 4OV_SalesOrders - Sales Orders

  3. Select both entries and press the Add Selection button to import both.

Define Target Objects

In the next steps, select the target connection and container including parameter settings.

  1. Select the Browse target connection icon.

  2. Choose SAP Datasphere as the target connection. By default, your space is set as target space.

Both source tables are auto-mapped to the target objects in the Replication Flow editor. We rename the target objects, removing the prefix ‘04V_’ in their names.

  1. Select target object 4OV_SalesOrderItems, choose Additional Options (…) and select Rename Target Object.
  1. Enter SalesOrderItems to the technical name in the Rename Target Object dialog popup and confirm it.

  2. Repeat the steps for the target object 4OV_SalesOrders and rename it to SalesOrders. The target object names should look like:

In the properties of the target object, we can set the replication behavior, and define the filter and mapping details. We do an initial load only. For the case the replication will be executed multiple times, we enable the truncate option for both target tables.

  1. Select target object SalesOrderItems.

  2. Mark the Delete All Before Loading checkbox in the properties panel, to overwrite existing data of target table SalesOrderItems.

  3. Select the second target object SalesOrders.

  4. Mark the Delete All Before Loading checkbox too.

We use the default mapping and filter settings in the replication flow. However, we take a look on these features and their capabilities, before we create our replication flow.

  1. Select Add to open the projections of SalesOrders.

  2. By default, the Filter section opens. Here, one or more columns of the source object can be selected, to define filter expression(s) and optimize the dataset for the replication.

    For example, the sales orders are recorded since 2015. If the business scenario requires sales orders for 2020 or later, a filter expression on the creation date column would limit the number of replicated records. For our scenario, we import all sales orders, but will define a date filter later in the Data Modeling unit.

  3. Select the Mapping section in the Projection overview.

    Here, column-mapping details can be specified. The names or data type of the target columns can be changed. Furthermore, columns can be removed or added, and their respective order adjusted.

  4. Select the Cancel button in the Projection overview. We only looked at the filtering and mapping features to highlight their capabilities. We will continue with the default mapping now.

Deploy and Run the Replication Flow

  1. Save the replication flow.

  2. In the dialog popup, enter the new replication flow name RF_SALESORDERS and Save it.

  3. Choose the Deploy icon to make your replication flow ready to run.

After successful deployment, a notification message appears and the status in the properties side panel changes to Deployed.

  1. Select the Run icon to start your replication flow of the two tables.

  2. Open the Data Integration Monitor link to get a detailed insight into the data replication task.

Monitor the Replication Task

  1. Refresh the ongoing status.

    Note

    The process might take a few minutes.

  2. When completed, select your space in the header navigation area to return to the Data Integration Monitor main overview.

In the Data Integration Monitor you can run and monitor data replication for remote tables, replication flows and task chains. Additionally, you can manage view persistency and track the queries sent to your remote connected source systems for your space.

  1. If the authorization notification is displayed in the Data Integration Monitor, click Authorize and confirm it in the pop-up window.

  2. To leave the Data Integration Monitor, select Data Builder in the side navigation area.

In the next steps, we verify the two replicated tables.

  1. Select SalesOrders to open the local table.

  2. In the table editor, choose the Data Viewer icon in the toolbar to view the replicated data.

  3. Close the table editor and return to the Data Builder object list.

  1. Select SalesOrderItems to open the second local table.

  2. Open the Data Editor in the toolbar to get an insight into the replicated data.

  3. Within the Data Editor data can be maintained, if necessary.

  1. Close the table editor and return to the Data Builder object list.

  2. The Data Builder perspective lists the created objects:

    • Replication flow RF_SALESORDERS
    • Target tables SalesOrders and SalesOrderItems

Congratulations! You have created a replication flow and copied both tables into your user space. In the modeling unit, these relational dataset objects will be linked as a fact view to the main data model.