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: 

XML to ABAP internal table

Former Member
0 Kudos

Hi, I have this xml file in my local directory: /usr/sap/tmp/vestiario.xml with this structure:


<NewDataSet> 
   <elenco> 
     <MATRMEC>005724Y</MATRMEC> 
     <CODTAGLIAART>T108 </CODTAGLIAART> 
     <CODTAGLIA>8 </CODTAGLIA> 
     <DESCRIZIONEMATERIALE>GUANTI DI PELLE UOMO </DESCRIZIONEMATERIALE> 
  </elenco> 
  <elenco>
     <MATRMEC>036097E</MATRMEC> 
     <CODTAGLIAART>T42 </CODTAGLIAART>
     <CODTAGLIA>2 </CODTAGLIA> 
     <DESCRIZIONEMATERIALE>CALZE COLLANT </DESCRIZIONEMATERIALE>
  </elenco> 
</NewDataSet>

Now I want to read this xml and fill an internal table with data.

How can I do it step by step?

Help me please. THANKS

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos

Create a [Simple Transformation|http://help.sap.com/saphelp_nw04/helpdata/en/a9/001540bf1af72ee10000000a1550b0/frameset.htm] and call it from your ABAP program. More info in previous discussions in these forums.

Thomas

3 REPLIES 3

Former Member
0 Kudos

Hi,

Try searching the forum.

Check this links:

Regards,

Gilberto Li

ThomasZloch
Active Contributor
0 Kudos

Create a [Simple Transformation|http://help.sap.com/saphelp_nw04/helpdata/en/a9/001540bf1af72ee10000000a1550b0/frameset.htm] and call it from your ABAP program. More info in previous discussions in these forums.

Thomas

0 Kudos

I created this XSLT for my XML but it does not work fine. Can someone help me please?



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

<tt:root name="T_ELENCO" type="?"/>
<tt:root name="MATRICOLA" type="?"/>
<tt:root name="TAGLIA" type="?"/>
<tt:root name="CODICE" type="?"/>
<tt:root name="DESCRIZ" type="?"/>


<tt:template>



<NewDataSet>
    <tt:loop name="elenco" ref="T_ELENCO">
    <elenco>
       <MATRMEC><tt:value ref="MATRICOLA"/></MATRMEC>
       <CODTAGLIAART><tt:value ref="TAGLIA"/></CODTAGLIAART>
       <CODTAGLIA><tt:value ref="CODICE"/></CODTAGLIA>
       <DESCRIZIONEMATERIALE><tt:value ref="DESCRIZ"/></DESCRIZIONEMATERIALE>
     <elenco>
    </tt:loop>
</NewDataSet>



</tt:template>

</tt:transform>