Skip to Content
0

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

Sep 11, 2017 at 09:19 AM

275

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member
Sep 12, 2017 at 06:26 AM
0

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/7264b5461a724c10acb71286e85d75ea.html

Best,

Thomas

Show 6 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

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/f6567e3b7334403b9b275426fbe4fb04.html

[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

0
Former Member

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

0

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.

0
Former Member

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

0

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

0