Skip to Content
0
May 06, 2011 at 09:58 AM

transform xml to ABAP

70 Views

Hi Experts,

I have an source xml file as shown below.i need the value from tag <DISPLAY_KEY>row2col2</DISPLAY_KEY>

for every <element index = 0> and <element index = 1> as they refer to rows and cols. Can someone please help getting the data in to internal table?

- <RESULT_SET state="DATA_AVAILABLE">
- <AXES>
- <AXIS name="ROWS">
- <TUPLES size="7">
- <TUPLE>
- <ELEMENT index="0"> -- *row1 col1*  
<DISPLAY_LEVEL>0</DISPLAY_LEVEL> 
  <DRILL_STATE>LEAF</DRILL_STATE> 
- <MEMBER name="row1col1" type="MEMBER" text="row1col1">
- <PRESENTATIONS>
  <DISPLAY_KEY>row1col1</DISPLAY_KEY> 
  </PRESENTATIONS>
  </MEMBER>
  </ELEMENT>
- <ELEMENT index="1"> -- *row1 col2*  
<DISPLAY_LEVEL>0</DISPLAY_LEVEL> 
  <DRILL_STATE>LEAF</DRILL_STATE> 
- <MEMBER name="row1col2" type="MEMBER" text="row1col2">
- <PRESENTATIONS>
  <DISPLAY_KEY>row1col2</DISPLAY_KEY> 
  </PRESENTATIONS>
  </MEMBER>
  </ELEMENT>
  </TUPLE>
- <TUPLE>
- <ELEMENT index="0">. -- *row2 col1*  
<DRILL_STATE>LEAF</DRILL_STATE> 
- <MEMBER name="row2col1" type="MEMBER" text="row2col1">
- <PRESENTATIONS>
  <DISPLAY_KEY>row2col1</DISPLAY_KEY> 
  </PRESENTATIONS>
  </MEMBER>
  </ELEMENT>
- <ELEMENT index="1"> -- *row2 col2*  
 <DISPLAY_LEVEL>0</DISPLAY_LEVEL> 
  <DRILL_STATE>LEAF</DRILL_STATE> 
- <MEMBER name="row2col2" type="MEMBER" text="row2col2">
- <PRESENTATIONS>
  <DISPLAY_KEY>row2col2</DISPLAY_KEY> 
  </PRESENTATIONS>
  </MEMBER>
  </ELEMENT>
  </TUPLE>

Edited by: Ananda Theerthan on May 6, 2011 11:59 AM