Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3668

Simple JSON transformation not working

$
0
0

Hi people,

 

I am working on a Simple Transformation to serialize ABAP data to JSON.

I pass an internal table to that transformation. During design time I have no information about the column names and types of the internal table.

My aim is to fetch the values of all columns per row and serialize all values as a big JSON array per record.

 

<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

   <tt:root name="RECORDS"/>

   <tt:template>

     <object>

       <array>

         <tt:loop ref=".RECORDS">

           <object>

             <array>

               <tt:loop ref="$ref.*">

                 <tt:value ref="$ref"/>

               </tt:loop>

             </array>

           </object>

         </tt:loop>

       </array>

     </object>

   </tt:template>

</tt:transform>

 

So I have one outer JSON array that covers all records. The inner array shall cover the actual values of all columns of the recent record.

 

However, when executing the transformation I receive this error message:

ERROR: Invalid XML document for serialization.

 

Anyone who can help?

 

Thanks!

Marco


Viewing all articles
Browse latest Browse all 3668

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>