Application Development and Automation 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: 
Read only

xml to abap internal table by using a dynamic internal table at runtime

Former Member
0 Likes
476

Hi ,

I have a requirement to convert xml to abap internal table . But the requirement is that i need to create internal table according to the XML .

Ex : If my XML is :

<?xml version="1.0" ?> 
- <flights>
- <airline code="AA" name="American Airlines">
- <flight number="0017">
  <from airport="JFK">NEW YORK,US</from> 
  <to airport="SFO">SAN FRANCISCO,US</to> 
  <departure>110000</departure> 
  <arrival>140100</arrival> 
  <type>Scheduled</type> 
  </flight>
- <flight number="0064">
  <from airport="SFO">SAN FRANCISCO,US</from> 
  <to airport="JFK">NEW YORK,US</to> 
  <departure>090000</departure> 
  <arrival>172100</arrival> 
  <type>Scheduled</type> 
  </flight>
  </airline>

So after conversion my abap internal table shoul have fields as :

airline_code     Name      flight_number   from_airport    to_airport      departure         arrival      type

and the field values should be corresponding field values .

Thanks in advance .

Regards .

Hi ,

I have a requirement to convert xml to abap internal table . But the requirement is that i need to create internal table according to the XML .

Ex : If my XML is :

<?xml version="1.0" ?> 
- <flights>
- <airline code="AA" name="American Airlines">
- <flight number="0017">
  <from airport="JFK">NEW YORK,US</from> 
  <to airport="SFO">SAN FRANCISCO,US</to> 
  <departure>110000</departure> 
  <arrival>140100</arrival> 
  <type>Scheduled</type> 
  </flight>
- <flight number="0064">
  <from airport="SFO">SAN FRANCISCO,US</from> 
  <to airport="JFK">NEW YORK,US</to> 
  <departure>090000</departure> 
  <arrival>172100</arrival> 
  <type>Scheduled</type> 
  </flight>
  </airline>

So after conversion my abap internal table shoul have fields as :

airline_code     Name      flight_number   from_airport    to_airport      departure         arrival      type

and the field values should be corresponding field values .

Thanks in advance .

Regards .

2 REPLIES 2
Read only

Clemenss
Active Contributor
0 Likes
392

Hi Ujjwal,

use

CALL TRANSFORMATION

Study the online documentation and if required do some search for CALL TRANSFORMATION and/or XML PARSER

And, when coming back here with next question, tell us what searches you did with what results - please always follow the 'search before post' rule, thank you.

Regards,

Clemens

Read only

Former Member
0 Likes
392

Hi ,

Im using type-pools ixml . I got how to bring that data in sap . But the main requirement is to convert it the internal table as mentioned above . there are various methods if_ixml_nodeget_value , if_ixml_nodeget_name etc . so how to use them or check to make an internal table using it .

Regards .