Skip to Content

Does /UI2/CL_JSON work in ABAP Cloud?

Hi All,

does anybody (esp Alexey Arseniev :-) know if /UI2/CL_JSON (or ZCL_JSON from https://wiki.scn.sap.com/wiki/display/Snippets/One+more+ABAP+to+JSON+Serializer+and+Deserializer) works in ABAP Cloud out of the box? If not, does anybody have an version which works in at least 750 AND ABAP Cloud?

Thanks,

Wolfgang

Add comment
10|10000 characters needed characters exceeded

6 Answers

  • Posted on Jun 03, 2019 at 12:30 PM

    Hello Wolfgang,

    /ui2/cl_json is used in S/4 Cloud. There are no issues with it.

    I am not an expert in SAP Cloud Platform and limitation of ABAP there, but technically /ui2/cl_json (or its local copy) shall be executable: the class is more or less self-contained and uses the only code from SAP_BASIS. Without and DB access. There is some code for conversion into base64, but I feel it shall not be a problem.

    I have also tried to check internally for some Cloud Platform based system, and it seems that /ui2/cl_json is included.

    Why you got concernces about it?

    BR, Alexey

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 04, 2019 at 12:29 PM

    Hello Wolfgang,

    I have done my check for class existence in one of the Steampunk test systems, but I have not realized that the class is not released for use...

    Yeh... Missing cl_abap_*descr is a big problem, while a lot of functionality based on RTTI data. Maybe ZIF_YY_DATA_ELEMENT can be a solution, but I do not know, how far it goes beyond simple types. /UI2/CL_JSON can support all possible data types, classes, and references. Plus /UI2/CL_JSON=>GENERATE use feature of dynamically created types, based on JSON structure. Maybe it can be an only a limited set of functions but would mean complete rebuild...

    JAK is in very early stage yet... But reimplementing the logic for fields mapping, I think, for it would be doable.

    Move to SXML_WRITER/READER is actually a good idea, I was also evaluating in standard, but would also mean significant effort.

    So, no good news regarding the usage of /ui2/cl_json for Steampunk.

    I would check with Sebastian, author of JAK, maybe we can somehow cooperate...

    BR, Alexey.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 05, 2019 at 06:48 PM

    Hi to all reading this and also wanting to have /UI2/CL_JSON accessible in ABAP Cloud (like Tomas Buryanek), please vote on https://influence.sap.com/sap/ino/#/idea/234724 for this!

    Many Thanks!

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08 at 06:50 PM

    /UI2/CL_JSON has (finally) been released with the latest hotfix collection.


    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 06, 2019 at 06:26 PM

    Hi Wolfgang,

    the use of /ui2/cl_json is not permitted in SAP Cloud Platform ABAP Environment (see attached screenshot).

    Best Regards,

    Andre


    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 05, 2019 at 09:40 AM

    Hi @wroeckelein.fum,

    OK, we will try to check with Sebastian what is possible with whitelisting or rebuilding of the /UI2/CL_JSON for Steampunk, but I am would not be very optimistic - it may be problematic to get it in, due to different reasons. And one of them is that it is actually not a standard ABAP class for JSON processing... But we would try to do our best.

    My comment about CL_SXML_WRITER/READER classes was not about using them directly, but encapsulating them in /UI2/CL_JSON class, keeping the API compatible, without any changes needed from the consumer side. It would move actual string maniplating logic from ABAP to the kernel, improving the performance drastically. The drawback would be a dependency on higher SAP_BASIS release plus, maybe some features drop, as support of partial serialization/deserialization. But still, that may be an idea for Steampunk optimized version.

    BR, Alexey.

    Add comment
    10|10000 characters needed characters exceeded