简体   繁体   中英

How do I store nested JSON objects directly in ABAP DDIC?

ABAP Databases, oracle, MaxDB et al., are mostly RDBMS. Right now, I have a JSON structure that cannot be normalised and hence I want to store it as is. So, I want a MongoDB like Object store in ABAP.

What's the best way to achieve this? Is data cluster an option? Perhaps the only option?

I don't think you can connect to some other then supported DBs directly from ABAP. If you have Netweaver Java, you can call some custom Java application, which accesses MongoDB. You can check SAP Hana if there is something similar. In ABAP you interact with RDBMS via ABAP Dictionary . It supports data types like LCHR , STRING , RAWSTRING . Checkout docs for more details.

Data cluster is one option, but you can simply use a binary type DB field for storing the JSON data.

There is a method called transformation in ABAP, which converts from ABAP data to XML/JSON data and vice-versa.

There's a simple example on the following blog: https://blogs.sap.com/2013/07/04/abap-news-for-release-740-abap-and-json/

Comments on the blog page contain more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM