Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

abap table to json with proper line breaks and indents written to output

0 Kudos

Is there a way to write out json format with proper line breaks and indentations? I have a request to to send this in a file. I am able to generate the json from abap but when writing it out its one long string with no breaks or indents. I have seen in a demo program that it can be "displayed" in this manner but am unable to figure out how to do this without using display from cl_demo_output.

Any feedback or ideas is much appreciated!

Thanks!

Mandie

1 REPLY 1

Florian
Active Contributor

There are a lot out there. What about that one. Should do the job:

https://wiki.scn.sap.com/wiki/display/Snippets/One+more+ABAP+to+JSON+Serializer+and+Deserializer

and just remembered that one here:

https://gist.github.com/mydoghasworms/2291540

~Florian