Skip to Content
Author's profile photo Fabian Lehmann

Use SAP HCP IoT Services and HCP Integration Services (HCI-DS) to get your Sensor Data – Part 2

In this blog i will explain how we can fetch the IoT Data from our HCP to our OnPremise landscape via SAP HCI-DS and the SAP Data Services Agent.


Please check the first blog to get an complete overview abou the story Use SAP HCP IoT Services and HCP Integration Services (HCI-DS) to get your Sensor Data – Part 1

scenario2.PNG

To get the data from our Tables we are usin SAP HANA Cloud Integration Data Service.

Log on to SAP HCI-DS via HANA Cloud Integration and enter your Organizatzion Name:

dsod.PNG

Create the Source Data Store

After you have successfully logged in we starting to create and new datastore to connect the HCP with the HCI DS.

Press the + button and fill the requiered fields, as Type select “SAP HANA application Cloud

newds.PNG

The Access Token is required to provide schema access for HCI DS.

Get the SDK

Get the SAP HANA Cloud Platform SDK and extract the archive on your favorite location and open an command prompt an enter the following commands.

Command Client Commands

List the schema on your HCP:

neo list-schemas -h hana<trial>.ondemand.com -a <HCP Account> -u <suser> -p <password>

sdk.PNG

Get the Acces Token:

neo grant-schema-access -i IoT -a <HCP Account> -h hana<trial>.ondemand.com -u <suser>-b hcids:dsprod

In my case the schema is already bound, so i want list my access token:

neo list-schema-access-grants -a <HCP Account>  -h hana<trial>.ondemand.com -u <suser> -i IoT

sdk2.PNG

Now we are ready and can use the access token in HCI-DS:

newds3.PNG

After the HCP data store is successfully added you are able to acces the HCP tables:

hcptablesathcids.PNG

Create the Targe Data Store


In this scenario i want to replicate my IoT data to a simple flat (csv) file, so we create a second one.

as Type select “File Format Group” and specify the target directory.

targetds.PNG

Add the table which u want to consume:

createfromtables.PNG

tables.PNG

Define the format details:

format.PNG

As result you can now see the assigned table and the corresponding columns:

reulst2.PNG

Create a  Project and Task


Now we change to the Projects tab an create an new project and an new task.

Create project:


createrproject.PNG

Create Task:


task1.PNG

Choose the source (our HCP data store):

task2.PNG

….and the target:

task3.PNG

As result we have now an project with an corresponding task:

result.PNG

Now we can define our data flow by click on edit:

edit.PNG

To define the data flow, first add the target object:

addtargetobject.PNG

addtargetobject2.PNG

dataflow.PNG

Now you can define what data you want to get, in my case i use all fields from the target (HCP).

I choose as source the same tabel as defined above by craeting the target source:

dataflow2.PNG

dataflow3.PNG

by clicking on the “Target_Query” object u can define the mapping between source and target:

automap.PNG

Result:

dfresult.PNG

Now you can creae the scheduler to define the intervall of the replication.

As prerequisite you nedd an active SAP Data Service Agent on your OnPremise Landscape.

In the next blog i will show you how to install the SAP Data Services Account and connect them with your SAP HCP and fetch the IoT Data.

Use SAP HCP IoT Services and HCP Integration Services (HCI-DS) to get your Sensor Data – Part 3

Cheers

Fabian

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.