Skip to Content
Author's profile photo Horst Keller

ABAP News for Release 7.40 – ABAP and JSON

ABAP and JSON? Didn’t we had that before? Yes we had but since the JSON support was made available in Release 7.40 and downported to 7.02 and 7.31 (SAP Notes 1648418 and 1650141) it shouldn’t be missed in a systematic overview over all important ABAP News for Release 7.40.

I will take the chance to shortly wrap up the facts about ABAP and JSON and point to the documentation where you can learn more.

JSON

JSON (JavaScript Object Notation) is a lean data exchange format, see JSON- Short Overview.

ABAP and JSON

The support of JSON in ABAP is based on the support of XML (but note that JSON is not XML).

A new format IF_SXML=>CO_XT_JSON of the sXML-Library allows JSON data to be handled with the same ABAP tools (methods and statements) as XML.

The trick is the usage of a JSON-XML-Format that maps JSON to XML and vice versa.

Like XML data, JSON data can be

When serializing ABAP data to JSON and deseralizing from JSON data to ABAP, you deal with asJSON, the canonical representation of ABAP data. asJSON can be seen as the JSON-XML representation of asXML (although there is not such an intermediate step internally).

Examples

Examples can be found here and also here.

Assigned Tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo James Marlin
      James Marlin

      The examples links are dead

      Author's profile photo Horst Keller
      Horst Keller
      Blog Post Author

      All links of the blog are leading to the same ressource and seem to work. Maybe the portal was not available temporarily?

      Author's profile photo Former Member
      Former Member

      The example links don't work for me either, HTTP error 404 is returned by the IIS hosting help.sap.com.

      Author's profile photo flavio ciotola
      flavio ciotola

      Hi Samuli,

      Links are working for me right now.

      Author's profile photo Former Member
      Former Member

      That's just weird, I'm still getting 404 errors...

      Author's profile photo Horst Keller
      Horst Keller
      Blog Post Author

      It is really weird. I observe the following for URLs like http://help.sap.com/abapdocu_740/en/index.htm :

      • With MS Internet Explorer sometimes I can access the URL  but sometimes I get the HTTP 404 errors.
      • With Firefox, Chrome and my Blackberrry I can always acces the URL.
      • With MS Internet Explorer I can always access the same files stored locally on my disk.

      I have no clue, why MS Internet Explorer does not work from time to time..

      If it doesn't work for you, please also try another browser.

      Author's profile photo Rüdiger Plantiko
      Rüdiger Plantiko

      I just tested it in this moment: The link

      http://help.sap.com/abapdocu_740/en/index.htm

      gives HTTP404 in all my browsers:

      • MSIE,
      • Firefox, and
      • Chrome

      (didn't check my Android phone, but I am pretty sure to have the same result there).

      I usually join any choir of Microsoft IE blamers - almost always there are good reasons.

      But this time, it seems to be the fault of the Microsoft IIS which apparently is used to serve help.sap.com 🙂  [Why not SAP Web AS with BSP, by the way?]

      Regards, Rüdiger

      Author's profile photo Horst Keller
      Horst Keller
      Blog Post Author

      [Why not SAP Web AS with BSP, by the way?]

      In fact, I have prepared that.

      Not BSP, but my own handmade HTTP-Service (see http://scn.sap.com/community/abap/blog/2013/07/22/abap-news-for-release-740--abap-keyword-docu-for-adt).

      Run program ABAP_DOCU_WEB_VERSION in any AS ABAP as of 7.02 and you'll see (even examples are executable since 7.40).

      All you need to do is to convince somebody to setup an AS ABAP and make the service publicly available 😉 .

      Author's profile photo Rüdiger Plantiko
      Rüdiger Plantiko

      Thank you, Horst, for the interesting link!