I have an anonymous array that I want to deserialize. Here is an example, all objects are the same, I just formed the first one.
[ { "time":"08:55:54", "date":"2016-05-27", "timestamp":1464332154807, "level":3, "message":"registerResourcePath ('', '/sap/bc/ui5_ui5/ui2/ushell/resources/')", "details":"","component":"sap.ui.ModuleSystem"}, {"time":"08:55:54","date":"2016-05-27","timestamp":1464332154808,"level":3,"message":"URL prefixes set to:","details":"","component":"sap.ui.ModuleSystem"}, {"time":"08:55:54","date":"2016-05-27","timestamp":1464332154808,"level":3,"message":" (default) : /sap/bc/ui5_ui5/ui2/ushell/resources/","details":"","component":"sap.ui.ModuleSystem"} ]
I tried to deserialize using CL_TREX_JSON_SERIALIZER , but this thing is damaged and does not work with my JSON (look at this question)
Then I tried / UI2 / CL_JSON . This thing needs a βstructureβ that is perfect for the object specified by the JSON object. "Structure" means in my case an internal table of objects with the attributes time, date, timestamp, level, message and details . There was a problem: this class does not handle references properly: it uses classdescription to describe the field assigned to the fields sign. Since I cannot have a list of objects, but there is only a list of referrals for objects, which usually does not present a problem. This solution does not work.
As a third attempt, I tried using CALL TRANSFORMATION , as described by Horst Keller , but with this method, which I could not read in an anonymous array. (Jagger commented on the best link of this ABAP 2 JSON and JSON 2 ABAP with ST )
My highlights are:
- I do not want to change JSON, since this is what I get from
sap.ui.log - I prefer to use the built-in features rather than the third-party platform.