Hi, I provide training in SAP UI5. Also feel free to checkout my new web page https://saptechblog.com
SAP HANA

Set up initial data load for tables in SAP HANA

 

This tutorial explains how to set up an initial load of data in the newly created table.

By doing so whenever the table gets activated in the new system, the data load which we will be providing through CSV file will gets loaded into the table.

To do this, we have to create three types of files in our project repository

1. CSV file – This is the file which contains the initial load of data

2. HDBTIM file (Table Import model) – This files Specifies the type of data import and the table in which data is to be imported

3. HDBTID(Table import data) file- This file specifies connection between the CSV file and the Table to be imported.

 Note: This method is not a mass upload of data, this is used when we are moving our repository project from one system to another, so that the table can contain data which are used in applications.

In the previous tutorial Database Schema and Tables we have seen how to create a database schema and table, We will proceed with the same tutorial and see how to import the data in the table.

Procedure:

1. Create the CSV File with the initial data load

2. Create the file for Table import model

3. Create the Table import data file

 

Create the CSV file with initial data load:

Create a CSV file in the project. Right click on the file and open with text editor.

clip_image001[4]

 

This process will open the excel, right click on the file and select open with text editor.

clip_image002[4]

 

Enter the values in the text editor separated by commas.

Note: Enter in the structure the database table has been created.

My structure of table from previous tutorial is:

clip_image003[4]

Data in the CSV file

clip_image004[4]

 

Save and activate the CSV file.

 

Create the Table Import model File

Create the file with extension hdbtim.

clip_image005[4]

 

Write the following code in the file:

clip_image007[4]

 

 

Here we have defined, the model of data to be imported, which is CSV file and in which table and the schema to which the table belongs.

 

Create a Table import Data file

Create a file with extension, hdbtid.

clip_image008[4]

 

Write the following code in the file.

clip_image010[4]

 

The implements keyword specifies the Table import model which is to be executed. Remember in the TIM file we have specified which table to be imported and how.

The csvfiles get the directory from where the CSV fiels is to be loaded and implemented.

 

Save and Activate the whole project: if you are not able to activate, then activate the tim first then tid file.

 

Output:

As mentioned already by me, this files import the data into the table when they are being activated. Now locate the schema and database table, open the data preview of table to see the data updated.

clip_image012[4]

 

 

About Arun

0 Comments:

Post a Comment

Powered by Blogger.