Skip to Content
0
Apr 13, 2012 at 02:15 PM

XSLT table to complex xml structure

70 Views

Hi Gurus,

I need help about STRANS functionality of ABAP.

I have a internal table and i show this table in ALV list. I want to send my alv list to legacy systems.

Normally i can create a xml document with concat fields in abap. But i want to use STRANS.

How can I transform itab to deep structure xml. Thanks a lot. I dont want to use string concat or xml classes.. I just want to use XSLT.

Thanks a lot

Volkan

Source xml of ITAB

<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">

<asx:values>

<ITAB>

<item>

<VBELN>0060000004</VBELN>

<KUNNR>0000000051</KUNNR>

<POSNR>000001</POSNR>

<MATNR>H1</MATNR>

</item>

<item>

<VBELN>0060000004</VBELN>

<KUNNR>0000000051</KUNNR>

<POSNR>000002</POSNR>

<MATNR>H2</MATNR>

</item>

<item>

<VBELN>0060000005</VBELN>

<KUNNR>0000000051</KUNNR>

<POSNR>000001</POSNR>

<MATNR>H1</MATNR>

</item>

</ITAB>

</asx:values>

</asx:abap>

Destination XML Must be like this

<?xml version="1.0" encoding="UTF-16"?>

<ROOT>

<ORDER>

<VBELN>0060000004</VBELN>

<KUNNR>0000000051</KUNNR>

<ORDERLINES>

<ORDERLINE>

<POSNR>000001</POSNR>

<MATNR>H1</MATNR>

</ORDERLINE>

<ORDERLINE>

<POSNR>000002</POSNR>

<MATNR>H2</MATNR>

</ORDERLINE>

</ORDERLINES>

</ORDER>

<ORDER>

<VBELN>0060000005</VBELN>

<KUNNR>0000000051</KUNNR>

<ORDERLINES>

<ORDERLINE>

<POSNR>000001</POSNR>

<MATNR>H1</MATNR>

</ORDERLINE>

</ORDERLINES>

</ORDER>

</ROOT>