Roelof Albers
Read all my blogsHow to show on premise data in C4C using SAP HANA Cloud Integration
One of the most requested developments within SAP Cloud for Customer (C4C) is extending screens with data from other resources.
This blog will be a step by step guide to display data from an on premise system in C4C via HANA Cloud Integration (HCI).
Developments can be split up in 3 different categories, i.e.: ECC, HCI and C4C. I will mainly focus on the C4C side, but will show some screenshots of the other developments as well.
On premise
First step is to create a function module that returns the correct data and create a web service from this function module.
In transaction SOAMANAGER or in the service definition we can download the WSDL of our web service. This WSDL is needed in HCI.
HCI
C4C Application Studio
Create a Business Object
- Add elements. In this case I have created a node with a cardinality of 0 till n, which represents a table.
- Add an action. This action will be calling the web service, but you can leave it empty for now.
Create an External Web Service Integration (WSID)
Implement your action
Create an Embedded Component to display the data
Open the Embedded Component in the UI Designer.
Drag an AdvancedListPane on the View in the Designer Tab.
In the DataModel tab you can see that a DataList structure has been generated.
Select the DataList on the left en Select your Node on the right side of the screen and press Bind. Move any additional fields you need from the right to left by dragging them on the structure. I have also created a structure called Inport with a field AccountID, this field will be used in the next step. Your structure should eventually look like this:
On the designer tab see the results of these bindings. I’ve changed the type of the fields to StaticText because we only want to display the data.
On the Controller tab we have to create an Inport. This Inport should call an Event Handler, which calls our BO Action to call the web service.
Our Inport has an importing parameter called AccountID (since we would like to extend the Account TI)
In the Properties of our Inport set RequestFireOnInitialize to True and create a new Event Handler:
The EventHandler should have the following Operations:
Underneath the Condition you have to Configure Operation, if the Condition is met, these Operations will be performed. Below operations will be performed only when /Root/ListID is empty.
We need to create an instance of our Business Object
And move the Inport parameter to our BO element.
The final step is to call our BO Action. In the highest level of the Event Handler we create a BOAction Operation and follow the steps below.
Activate all items.
Add your Embedded Component to an existing screen
In our example we want to extend the Account TI. Open the Configuration Explorer to find the correct screen.
In the COD_Account_TI we have the options to add our Embedded Component to a screen via the Exenstibility Explorer.
In this example we want to add it to our Overview Tab. Press Add embedded Component to Pane and select your EC as shown below.
Next press Bind to bind the parameters of the Account TI Outport to your EC Inport parameters
We should the PublicOutportECCCustomerRoot as outport and bind the AccountID to our Inport AccountID parameter.
Activate the Account TI and check if everything is working as designed. If all went well you will hopefully see something like this 🙂
5 responses to “How to show on premise data in C4C using SAP HANA Cloud Integration”
very Illustrative!
When insert the code in the action in the last line: this.List.Create(item);
Show an error:
When creating an association, the path expression in front of the association must not contain a collection.
Hi Carlos,
Did you create the action with the checkbox mass enable on? Please try to re-generate with this checkbox off, and try again.
BR,
Roelof
Hi Roelof,
Thanks a lot for your answer and your help, I was able to solve the problem I had, but I have a query I'm getting a message that says "Unexpected error during back end processing" , I made the tracing and I can´t know what it is.
Regards,
Carlos
Hi Carlos,
That is a very generic error message. Do you receive the error when you make the call? Does the call reach your HCI?
For exception handling and tracing this is a really good blog:
https://blogs.sap.com/2016/05/15/how-to-troubleshoot-and-handle-exceptions-in-c4c/
Good luck!