简体   繁体   English

如何将嵌套的JSON对象直接存储在ABAP DDIC中?

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

ABAP Databases, oracle, MaxDB et al., are mostly RDBMS. 甲骨文,MaxDB等人的ABAP数据库大多是RDBMS。 Right now, I have a JSON structure that cannot be normalised and hence I want to store it as is. 现在,我有一个无法规范化的JSON结构,因此我想按原样存储它。 So, I want a MongoDB like Object store in ABAP. 因此,我想要一个像ABAP中的对象存储之类的MongoDB。

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. 我认为您不能直接从ABAP连接到其他一些当时支持的数据库。 If you have Netweaver Java, you can call some custom Java application, which accesses MongoDB. 如果您具有Netweaver Java,则可以调用一些自定义Java应用程序,该应用程序可以访问MongoDB。 You can check SAP Hana if there is something similar. 您可以检查SAP Hana是否存在类似内容。 In ABAP you interact with RDBMS via ABAP Dictionary . 在ABAP中,您可以通过ABAP词典与RDBMS进行交互。 It supports data types like LCHR , STRING , RAWSTRING . 它支持LCHRSTRINGRAWSTRING类的数据类型。 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. 数据集群是一种选择,但是您可以简单地使用二进制类型的DB字段来存储JSON数据。

There is a method called transformation in ABAP, which converts from ABAP data to XML/JSON data and vice-versa. ABAP中有一种称为转换的方法,可以将ABAP数据转换为XML / JSON数据,反之亦然。

There's a simple example on the following blog: https://blogs.sap.com/2013/07/04/abap-news-for-release-740-abap-and-json/ 以下博客上有一个简单的示例: https : //blogs.sap.com/2013/07/04/abap-news-for-release-740-abap-and-json/

Comments on the blog page contain more info. 博客页面上的评论包含更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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