Integrate your IoT data with SAP HCP, integration service
In my last blog (Visualize your IoT Data with SAP BusinessObjects Cloud) i show you, how easily you can visulaize your SAP HCP IoT data with SAP BusinessObject Cloud.
Two weeks ago i have the plessure to present at DSAG conference in Nürnberg. The scenario is quite simple. We fetch the SAP HCP IoT data, via HCP integration service an post ist to an OnPrem (S/4) HANA System for futher processing:
In the next few lines i will show ho easily you can achieve this whit the SAP HCP, integration service standard OData Adapter.
So lets start…..
Access SAP HCP, integration sercice (aka SAP HCI)
Since few weeks SAP HCP integration service can be found via the “Services” in the HCP cockpit:
But why ever only the public “Content Hub” can be accessed and not your tenant itself:
In fact of this we go directly to our SAP HCP IS account, the tenant link can be found in the cockpit under “Subscriptions”:
For the configuration of our simple scenario we press the “pencil” icon:
Create the HCP, integration service package and the Integartion Process (IFlow)
In the Design perspective we create first a new “Integration Package”:
Now we add our new artifact from type “Process Integration” to our package:
Enter some details to identify your integration scenario and save your settings:
Configure the IFlow
Open the “Integration Flow” and click on the edit button to configure your integration scenario.
On the left side you can found all required objects:
The next step is to remove first the “Sender” and add to receivers (SAP HCP and SAP HANA) Futhermore we also remove the standard start event and use a simple timer based start event to fetch the HCP IoT Data.
If we have now our primary objects in place we start with an external call object to fetch the data from the “HCP IoT Service OData API”:
Connect the “Request Reply” object with our “SAP HCP” receiver and choose OData as “Adapter Type”:
To configure the OData adapter you need the endpoint of the HCP IoT Services.
SAP HCP IoT OData Endpoint
The OData endpoint from the HCP IoT Services can be found in the “Message Management Service Cockpit”:
In the table overview you can access the OData API on the top left:
Configure the OData adapter (HCP side)
Now we use these (Service Root) endpoint, specify the authentification (here basic auth) and the credential name. The credential for basic auth can be specified via the “Manage Security Material” which can be found in the monitor (eye symbol) area at SAP HCP IS:
Now press modify to define the query and enter the system details for the connection to the SAP HCP IoT OData endpoint:
After you click the “Modify” button you must connect to the OData service or you can use a local EDMX file. In this case i want to connect directly to SAP HCP:
System: <System Name e.g. SAP HCP>
Password: <your password>
After the connection is sucessfulyy etablished you can now select the table and you are able to define the fields which you want to get from the OData service into your SAP HCP IS.
SAP Gateway OData service
No we need to transform our source to our target structure, for this i´ve defined a SAP Gateway OData service which post the data to our SAP HANA system.
For the futher processing i request the service via chrome or SAP Gateway Client:
Download the EDMX file on my local system:
Define the mapping between SAP HCP and SAP HANA
Now we want to define the mapping between the SAP HCP IoT structure (source) and our SAP HANA system (target):
Add Source message:
Add Target message:
Define the mapping (simple 1:1):
As result we have now the mapping step in place:
Create a Splitter
The next artifact we need is now a splitter which breaks down our structure in single messages:
In the settings of the splitter we define the XPATH to our OData set:
Configure the OData adapter (HANA side)
Now we ready to connect our end event to our SAP HANA onPrem system and define the endpoint:
Now you can modify the query change the operation fom get to post and specify your fields:
Deploy, monitor and check the result
The final structure of our integration process (flow) looks like this:
The last steps which we need to do is now to Deploy our integration flow:
After he deployment is successfuly finished we can check the message monitoring:
Open your eclipse or the HANA web ui and verify the data which was post to your SAP HANA onPrem system:
I think you can see how easily you can fetch your IoT data with SAP HCP integration service.
Now you are able to analyze or process futher activities/processes on the raw IoT data.