Reputation: 4202
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?
Upvotes: 0
Views: 2553
Reputation: 13686
To say it shortly:
You can simply store JSON in a LOB column of any RDBMS, which corresponds to the data types STRING
(characters/CLOB) or RAWSTRING
(bytes/BLOB) in the ABAP Dictionary.
That's it.
PS: concerning the two other answers:
LCHR
which is limited to 32000 characters (nor LRAW
which is limited to 32000 bytes)Upvotes: 0
Reputation: 1301
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.
Upvotes: 1
Reputation: 4132
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.
Upvotes: 1