Skip to Content

Introduction


A few months ago I was asked by my team lead Chris Paine to investigate using the HANA Cloud Integration solution to move data to and from SAP and SuccessFactors. He wanted to know how easy/hard this was and we thought actually trying it out was the best way to measure this.


It took a bit of effort to understand how everything worked, and we thought that it would be worthwhile sharing our experience here with others in the hope that it’s easier for you!


Starting with the Help:

As suggested by online help we could use SAP Cloud Connector directly to access OData service with SAP HCI adapters.

https://proddps.hana.ondemand.com/dps/d/preview/93810d568bee49c6b3d7b5065a30b0ff/2015.05_CORR2/en-US/frameset.html?65a60e750eca49328fef93c0723ad4b8.html


When I first signed up with the SAP HCI Trial programme, I tried to use this approach but failed miserably.  🙁 Whilst the online help isn’t particularly descriptive, I couldn’t find any blog or descriptive instruction on how to get this working end to end. Unfortunately it was much later in my trial of the solution that I learned that this approach will not work with trial participants. This is a shame, but hopefully the HCI trial team can look at working something else out, as they were very helpful in solving various other issues we had during the trial.

As I found it very hard to build an integration without any detailed step by step blogs or documentation on SCN, I thought that it would be best to share an example, we will be using SAP HCI to fetch data from SuccessFactors and follow by updating a custom table in SAP On-Premise.

UseCase.png


SuccessFactors

In SuccessFactors, we will use the Currency Conversion data and it’s API. You can either update these currency conversion data manually in SuccessFactors or you could use SAP HCI to leverage on free online exchange rate data (eg: https://currencylayer.com )

Picture16.png

On-Premise SAP System


Create a custom Z table. (Or you can use standard SAP tables if you wish)

Picture17.png

Create a gateway service using the custom table above.

Here is a reference on how to create a simple gateway service:

http://scn.sap.com/community/gateway/blog/2014/11/02/simple-step-by-step-sap-gateway-service-guide

An example from my Gateway service builder

Picture18.png

Go to the Gateway Client and create EDMX file.

Picture1.png

Save your EDMX  file. We will need this file when configuring the OData adapter in Eclipse. (NB you have to save the file as you can’t directly pull the metadata from the on Premise connection using the Model Operation area in HCI. I don’t know why, but this is the solution!)

SAP HCI Tenant

Get tenant ID (Account Name) of your SAP HCI tenant from Eclipse.  You will need the tenant ID as the account name when configuring SAP Cloud Connector

Picture4.png

SAP Cloud Connector Configuration

Install SAP Cloud Connector on your on-premise system & start the Cloud Connector

Here is a reference on how to install the SAP Cloud Connector on different operating systems:

https://help.hana.ondemand.com/help/frameset.htm?57ae3d62f63440f7952e57bfcef948d3.html

Login to the SAP Cloud Connector once the Cloud Connector is running (Default URL – https://localhost:8443 )

Picture19.png

Establish connection to your SAP HCI tenant by adding new account.

Picture3.png

Picture5.png

Configure on-premise SAP system and map it to a virtual host and port. If you would like to use Certificate based Authentication, select HTTPS and the corresponding port. (NB this is the point where the trial landscape doesn’t work! 🙁 )

Picture6.png

Once the system has been mapped, define the permitted resources that you wish to grant access to.

Picture20.png

SAP HCI Configuration

Now, in the Eclipse, we would build an iFlow to fetch the currency conversion rates from SuccessFactors, map the data to a different format and finally, updates a custom table in the SAP system by using OData adapter.

Here is the iFlow will look like:

Picture21.png

Configure the SuccessFactors Adapter as a Receiver Channel

Picture22.png

Open the Operation Modeler wizard, specify the SuccessFactors address, Company ID, Username and Password which you are connecting to. Select “CurrencyConversion” from the entity list.

Picture23.png

Select the Operation and Fields of the Entity

Picture24.png

Once the operation modelling is finished, an XSD is generated in src.main.resources.wsdl automatically.

Picture9.png

Before we configure the receiver channel for SAP, we need to import the EDMX file which we generated earlier

Picture25.png

Now, moving on to the receiver channel for SAP, configure the OData communication channel as below

Picture26.png

Using the Operation Modeler, select “Local EDMX File”.  Click on the “Browse” button to select the edmx file to proceed.

Picture27.png

Select “CurrencySet” from the entity list.

Picture11.png

Select the “PUT” Operation and Fields of the Entity we are updating.

Picture28.png

Once the operation modelling is finished, an XSD is generated in src.main.resources.wsdl automatically.

Ensure “On-Premise” is selected as the Proxy Type in order to use SAP Cloud Connector.

Authentication type as defined in the SAP Cloud Connector. In this example, it will be Basic Authentication.

Picture10.png


Deploy User Credentials Artifacts

In order for the adapter to authenticate, we need to deploy “User Credentials” arctifacts. The name of the artifacts will have to be the same Credential Name referenced in both communication channels. In this example, we named the arctifacts “sap_odata” and “sf_odata”

Picture14.png

Message mapping 

In this step, we need to map the incoming message to the message type required by SAP. The Mapping step can be added to the integration flow canvas from the Palette. In the Message Mapping Overview tab, add the .XSD files generated earlier and define the mapping as below:

Picture30.png

Split Incoming Payload

Here we need to split the incoming payload to individual messages for each currency code.

Picture15.png

Add Splitter to the integration flow canvas by selecting from the Palette. Configure a “General” splitter with the following properties:

Picture31.png

Here is more information on splitting messages:

http://scn.sap.com/community/pi-and-soa-middleware/blog/2015/01/16/blog-6-splitting-messages-in-integration-flows

Deploy

Set Timer Start Event to “Run Once”. This should allow the iFlow the run immediately once deployed.

Picture32.png

Now, deploy the Integration Project. In the message monitoring view, you should be able to see the status of the iFlow.



Here is the results after a successful run:

In the SAP system, the custom Z Table is updated with Currency code, timestamp and exchange rates. (Image: Below left)

Picture34.png

If you have activated the ICF recording in SAP system,you will first find a “GET” request with “x-csrf-token: fetch” in the header to obtain the X-CSRF-Token, then follow by “PUT” request to update the data in SAP system. (Image: Above right)



Here is the audit log from SAP Cloud Connector showing my user accessing the ICF service

Picture35.png

Potential Bug


The iFlow seems pretty simple and straight forward. But during this exercise, there was an error that kept giving me grief whenever it tries to update SAP system via the OData adapter. Fortunately the HCI trial team pointed out to me that the header in the message after fetching data from SuccessFactors is the caused of it. The “SystemQueryOption” with the value of “$select=lastModifiedDateTime”  in the message header was flows all the way through to the OData channel for SAP system. To resolve the error, she suggested to have a “Content Modifier” with the same header parameter and the value is set to blank string.

Picture37.png

I hope you found my blog (it’s my first) useful. I’d love to hear your comments. If you’re in Australia (Melbourne) and want a demo of it working, please let me know, I’d love to help out.

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Dieter Bauer

    Hi Wei Chen, this is a great blog and exactly what I was trying\hoping to do myself. However I am experiencing an issue connecting the cloud connector to our HCI tenant. I have used the same Cloud connector instance before to connect to the Hana Cloud Platform and and didn’t have any issues. Did you have to do any certificate related configuration as part of the initial setup of the Cloud connector. When I define my HCI tenant using the add account function and press the ok button I am getting the error authorization problem when downloading the configuration and by closer look into the cloud connector logs I can see the that the actual error message is SCC handshake failed: 403 — Forbidden which indicates to me that there are some certificates exchanged between Cloud connector and HCI before the connection is established. How did you get over this issue? I searched everywhere but couldn’t find any information that helped me to resolve that issue. I then found your blog and thought that you might have had that same issue initially. Thanks in advance for you help. Dieter

    (0) 
    1. Wei Chen Wong Post author

      Hi Dieter, unfortunately I didn’t have issues adding the tenant sccount in my SCC. Also did not add any cert as part of the configuration. Most of my issues i faced is around the Eclipse.

      (0) 
    2. Wei Chen Wong Post author

      Hi Dieter, any luck with the issue? I’ve relayed your issue to one of the SAP mentor  at SAPTechEd, he was saying that its worth checking your HCI tenant version that you subscribed to. That might be the caused of it.

      (0) 
  2. Dieter Bauer

    Hi Wei Chen, thanks for remembering and getting back to me. You are spot on, the HCI version our partner tenant is on does not support the Cloud connector and we are expecting an upgrade of our tenant in the next few weeks.

    Stay in touch and keep up the good work.

    Dieter

    (0) 

Leave a Reply