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

Parse XML To Internal Table

Former Member
0 Likes
819

Hi,

I need to parse XML to internal table.XML will be in the format which i have shown below.

<?xml version="1.0" encoding="utf-8" ?>

-<Msg type="B">

<E_MATERIAL_DETAILS C1="100-100" C2="0000001000" C4="135.98" C0="005056A400D91DDDBFCF2CC4FE631570" C3="ST" tv="005056A400D91DDDBFCF2A849DE9F570" />

<E_MATERIAL_DETAILS C1="100-200" C2="0000001000" C4="72.7" C0="005056A400D91DDDBFCF2CC4FE633570" C3="ST" tv="005056A400D91DDDBFCF2A849DE9F570" />

<E_MATERIAL_DETAILS C1="CH-2050" C2="0000001000" C0="005056A400D91DDDBFCF2CC4FE635570" C3="KG" tv="005056A400D91DDDBFCF2A849DE9F570" />

<E_MATERIAL_DETAILS C1="CH-2060" C2="0000001000" C0="005056A400D91DDDBFCF2CC4FE637570" C3="KG" tv="005056A400D91DDDBFCF2A849DE9F570" />

</Msg>

I have to parse this XML to my internal table..

Internal table structure will be like this..

data : begin of itab occurs 0,

c0(20),

c1(20),

c2(20),

c3(20),

c4(20),

end of itab.

How to achieve this.. Please Guide me..

Regards

Bala.

5 REPLIES 5
Read only

Former Member
0 Likes
666

Hi ,

Kindly go through this link below:

Hope it helps

Regrds

Mansi

Read only

GauthamV
Active Contributor
0 Likes
666

SEARCH in Scn you have so many posts on the same like these.

[xml to internal table|https://forums.sdn.sap.com/click.jspa?searchID=22566581&messageID=6318699]

Read only

Former Member
0 Likes
666

hi:

have a look

[Link|http://help.sap.com/saphelp_nw04s/helpdata/en/48/c21940a65ec442e10000000a1550b0/content.htm]

Regards

Shashi

Read only

0 Likes
666

Hi,

I can able to parse into my internal table if the XML is having separate tag for each columns, here the XML is not having separate tag, instead it is having separate tag for each row.

Like this.

<E_MATERIAL_DETAILS C1="100-100" C2="0000001000" C4="135.98" C0="005056A400D91DDDBFCF2CC4FE631570" C3="ST" tv="005056A400D91DDDBFCF2A849DE9F570" />

This is my problem..

Regards

Bala..

Read only

0 Likes
666

Thanks to all. Problem Solved.

Regards

Bala.