cancel
Showing results for 
Search instead for 
Did you mean: 

How to Convert IoT data via OData into an IDoc in SCI/HCI

Former Member
0 Kudos

Hello All,

I am working on a process where I need to convert messages coming from IoT service in SAP Cloud Platform into an IDoc to post into an on premise ECC system. I am using OData adapter to fetch the messages from IoT with a pull mechanism. In the next step I would need to convert the OData(Edmx) into XML/XSD and then map that into an IDoc. But I am not able to achieve this. I am not sure what artifacts (splitter, content modifier) need to be used and how will be xpath if we are using this. My iFlow runs with status completed where as I don't see a trace what is happening after the pull from IoT service even though the trace is in debug mode.

How should I proceed. Or is there a better way to get IoT data into my HCI and convert the same to an XML other than using OData adapter.

Please help me with your inputs. Thanks in advance.

Regards

Amitabh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

apart from using the OData API you can also connect to the database directly. Maybe this is an option for you:

https://help.sap.com/viewer/7436c3125dd5491f939689f18954b1e9/Cloud/en-US/7264b5461a724c10acb71286e85...

Best,

Thomas

Former Member
0 Kudos

Yes Thomas. This definitely looks to be another option. Thanks for sharing this. But how can I achieve this. I could not really find a way to do it. Also their is a disclaimer talking about SQL processing service. Can you please share some more info on this.

Regards

Amitabh

Former Member
0 Kudos

One more thing, Thomas where you can help. Also I am not sure how can I consume a HANA XS application in HCI which will be reading the IoT table and then to convert/map the table entries into a receiver IDoc. Please suggest.

Regards

Amitabh

anton_levin
Advisor
Advisor
0 Kudos

Hello Amitabh, please have a look in the online documentation on how consumption of the SAP HANA / SAP ASE Service work in the Neo Environment [1]. You might also want to check 2 consumption samples from the IoT StarterKit where consumption is shown for both Java [2] and XS [3] cases in the context of IoT MMS.

Regards,

Anton

[1] https://help.sap.com/viewer/d4790b2de2f4429db6f3dff54e4d7b3a/Cloud/en-US/f6567e3b7334403b9b275426fbe...

[2] https://github.com/SAP/iot-starterkit/tree/master/neo/apps/java/consumption

[3] https://github.com/SAP/iot-starterkit/tree/master/neo/apps/xs/consumption

anton_levin
Advisor
Advisor
0 Kudos

Your XS app may expose RESTful API (data from the DB table in the JSON format) which could be consumed by the HCI HTTP Adapter but, to be honest, I have never tried HCI HTTP Adapter myself.

Former Member
0 Kudos

Hello Anton,

Somehow I could reach up to a level with the OData adapter to fetch the data from IoT and pushing it further into other system. But I am stuck at a point where mapping not working. In my simulate mode the mapping works fine however when I deploy the iFlow I get an error for my mapping. Can you please suggest what should I check here.

com.sap.xi.mapping.camel.XiMappingException: com.sap.aii.utilxi.misc.api.BaseRuntimeException: The markup in the document following the root element must be well-formed., cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 23; The markup in the document following the root element must be well-formed.

Please note I am mapping the XSD fetched from IoT to my IDoc in XML format.

Regards

Amitabh

former_member198979
Participant
0 Kudos

Hi Amitabh,

Its more like a mapping error where context or data of the nodes must handle properly in the mapping so kindly check on the target and source root node occurrence as well as run time mapping namespace once.

- Chandan