SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Create a Flow Graph to Replicate Data

Create a flow graph using SAP HANA service smart data integration for SAP BTP to replicate data into SAP HANA service for SAP BTP.

Overview

🎓 beginner 15 min. SAP HANA Service For SAP BTPBeginnerSAP HANA

You will learn

  • โœ”How to Create a Virtual Table in SAP Web IDE
  • โœ”How to create a flowgraph to load data from the virtual table
Thomas Jung T Thomas Jung November 21, 2022
Created by February 20, 2019
Contributors

Prerequisites

Prerequisites

  • This tutorial is designed for SAP HANA service for SAP Business Technology Platform. Consider newer tutorials designed for SAP HANA Cloud.
  • You have configured SAP HANA service smart data integration for SAP BTP as explained in this tutorial.
  • You have created a remote source and configured the access as explained in this tutorial.

Steps

Intro

This tutorial cannot be completed with a trial account.


Step 1 Create a Virtual Table
โ€”

Create a new virtual table in db/data.

Create Flowgraph
Create Flowgraph

Call it vt_salary_data and flag Generate configuration file

Create Flowgraph
Create Flowgraph

Fill the Properties as follows:

  • Remote Source Name: LocalFile
  • Database and Schema name: <NULL>
  • Object Name: salarydata

Create Flowgraph
Create Flowgraph

Save and open the File Format Editor

Create Flowgraph
Create Flowgraph

Here you can adapt the inbound file format. Change Skipped Header Lines to 1.

Create Flowgraph
Create Flowgraph

Copy the following lines to the simulation and run it. These have been taken from the salarydata.csv file

Text
ID,SALARY,START_YEAR,GENDER,REGION,T-LEVEL
100001,139171,1998,m,APJ,T5

Create Flowgraph
Create Flowgraph

Use the Copy function and then use the pencil to edit the data types

Create Flowgraph
Create Flowgraph

Change the types as follows:

Create Flowgraph
Create Flowgraph

Save and Build the database module

Create Flowgraph
Create Flowgraph

As a reference, here is the code for the virtual table. You can access this mode by right-clicking on the virtual table artifact and choosing Open Code Editor.

Text
VIRTUAL TABLE "vt_salary_data" AT "LocalFile"."<NULL>"."<NULL>"."salarydata"

REMOTE PROPERTY ‘dataprovisioning_parameters’=’ <Parameters> <Parameter name=“FORMAT”>CSV</Parameter> <Parameter name=“FORCE_FILENAME_PATTERN”>%.csv</Parameter> <Parameter name=“PARTITIONS”>0</Parameter> <Parameter name=“CODEPAGE”>utf-8</Parameter> <Parameter name=“LOCALE”>en_US</Parameter> <Parameter name=“SKIP_HEADER_LINES”>1</Parameter> <Parameter name=“ROW_DELIMITER”>\n</Parameter> <Parameter name=“QUOTED_TEXT_CONTAIN_ROW_DELIMITER”>false</Parameter> <Parameter name=“COLUMN_DELIMITER”>,</Parameter> <Parameter name=“EXPONENTIAL”>E</Parameter> <Parameter name=“LENIENT”>true</Parameter> <Parameter name=“COLUMN”>ID;INTEGER;</Parameter> <Parameter name=“COLUMN”>SALARY;FLOAT;</Parameter> <Parameter name=“COLUMN”>START_YEAR;INTEGER;</Parameter> <Parameter name=“COLUMN”>GENDER;NVARCHAR(1);</Parameter> <Parameter name=“COLUMN”>REGION;NVARCHAR(4);</Parameter> <Parameter name=“COLUMN”>T-LEVEL;NVARCHAR(200);</Parameter> </Parameters>’;

Code
Step 2 Create a Flowgraph artifact
+
Step 3 Add the data source
+
Step 4 Add a Data Target
+
Step 5 Execute the Flowgraph
+
Step 6 Check data
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 6
1. Create a Virtual Table 2. Create a Flowgraph artifact 3. Add the data source 4. Add a Data Target 5. Execute the Flowgraph 6. Check data

Learn more →