Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering SAP ABAP

You're reading from   Mastering SAP ABAP A complete guide to developing fast, durable, and maintainable ABAP programs in SAP

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781787288942
Length 548 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (4):
Arrow left icon
Wojciech Ciesielski Wojciech Ciesielski
Author Profile Icon Wojciech Ciesielski
Wojciech Ciesielski
Philipp Deth Philipp Deth
Author Profile Icon Philipp Deth
Philipp Deth
Paweł Grześkowiak Paweł Grześkowiak
Author Profile Icon Paweł Grześkowiak
Paweł Grześkowiak
Wojciech Ćwik Wojciech Ćwik
Author Profile Icon Wojciech Ćwik
Wojciech Ćwik
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Creating Custom Code FREE CHAPTER 2. The Basic Structure of ABAP 3. Database Access in ABAP 4. Import and Export to Document Formats 5. Exposing Data to Print Forms 6. ABAP and XML 7. Building User Interfaces 8. Creating Stunning UI5 Interfaces 9. Business Object Processing Framework 10. Modification and Customization Techniques 11. Handling Exceptions in ABAP 12. Testing ABAP programs 13. Advanced Techniques in ABAP Objects 14. Integrating SAP with Third-Party Systems 15. The Background Processing of ABAP Programs 16. Performance and Optimization of ABAP Code 17. Assessments 18. Another Book You May Enjoy

sXML library for XML and JSON


In this chapter, we will handle conversion of the XML format to JSON format. It's become much easier since releases 7.02 and 7.03/7.31 (Kernelpatch 116), as JSON is now natively supported. To handle JSON format, we will use the sXML library.

Before we start, there are a few important things to mention:

  • In SAP, we will be dealing with so-called JSON-XML. It's a special XML format that enables JSON data to be described using an XML representation.
  • In sXML, JSON is handled by a new format stored behind the constant value of the sXML interface, IF_SXML=>CO_XT_JSON.
  • For serialization and deserialization we will be using transformation with identity ID.

JSON-XML format is required because ST can't interpret JSON; it can use only XML. So, the trick is to get the temporary format and then use the JSON writer class to convert it into the final format. So as to have a better understanding of what the JSON format is, analyze the following example: 

   //JSON
  {
   "CARRID...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime