cancel
Showing results for 
Search instead for 
Did you mean: 

xml file into internal table

Former Member
0 Kudos
129

Hi expert,

i am new to this.

i have a xml file:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>

- <RES SN="1" EN="3">

<M>197000</M>

- <R N="<b>1</b>" MIME="application/pdf">

<UE>16052007101641_Im%2520NB.pdf</UE>

<T>Technoconcept Preisliste </T>

<SU><b>...</b> IM <b>Thinkpad</b> <b>...</b></SU>

<LANG>en</LANG>

- <HAS>

<L />

<C SZ="" CID="henz8UqtxSoJ" ENC="UTF-8" />

</HAS>

</R>

- <R <b>N="2" L="2"</b> MIME="application/pdf">

<UE>16052007101641_IM%2520NB.pdf</UE>

<T>PREIS</T>

<SU><b>...</b> 16% MwSt. <b>sem</b> R Serie</SU>

<LANG>de</LANG>

- <HAS>

<L />

<C SZ="" CID="O6mX2_cHiB0J" ENC="UTF-8" />

</HAS>

</R>

- <R N="<b>3</b>">

<UE>_IM%2520NB.pdf</UE>

<T>Technoconcept </T>

<SU> IM</b></SU>

<LANG>en</LANG>

- <HAS>

<L />

<C SZ="" CID="henz8UqtxSoJ" ENC="UTF-8" />

</HAS>

</R>

</RES>

but this is with dynamic notes, see like <R N="1">, <R N="2"> ,<R N="3"> , i want to parse this xml into a internal table

e. g.

<UE>IM%2520NB.pdf</UE>

<T>Technoconcept </T>

<SU><b>...</b> IM <b>Thinkpad</b> <b>...</b></SU>

<LANG>en</LANG>

in

STRUCTUR or internal table

U

T

S

LANG

How can i do this?

Thanks a lot

Regards

Shuo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

go thru these threads

<b>Rewards if helpful</b>

Swati

Answers (3)

Answers (3)

vaibhav_tiwari
Contributor
0 Kudos

HI,

you can use function 'DOWNLOAD' as following.

CALL FUNCTION 'DOWNLOAD'

EXPORTING

filename = 'XML File'

filetype = 'ASC'

TABLES

data_tab = <itab>.

Former Member
0 Kudos

Hi,

if you are not comfortable with XSLT do the following

1. read the xml into a string

2. convert the string to xstring using SCMS_STRING_TO_XSTRING

3. now use FM SMUM_XML_PARSE and pass the xstring xml_input parameter of that function.

this will parse the whole xml and give you an itab of element name value pairs which you can read easily

Regards

Former Member
0 Kudos

Hi Kiran,

i try myself for your guide.

regards

Shuo

Former Member
0 Kudos

Hi all,

can somebody help me ?

Thanks a lot

Best regards.

Shuo

Former Member
0 Kudos

Hi,

Use Call Transformation to convert XML to Abap Structures.

CALL TRANSFORMATION {trans|(name)}

[PARAMETERS {p1 = e1 p2 = e2 ...}|(ptab)]

[OBJECTS {o1 = e1 o2 = e2 ...}|(otab)]

[transformation_options]

SOURCE {XML sxml}

| {{bn1 = e1 bn2 = e2 ...}|(stab)}

RESULT {XML rxml}

| {{bn1 = f1 bn2 = f2 ...}|(rtab)}.

Regards.,

Shruthi R

jaideeps
Advisor
Advisor
0 Kudos

hi,

check out this link..

https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=xmlfileintointernaltable+++++&adv=false&sortby=cm_rnd_rankvalue

thanks

jaideep

*reward points if useful..

Former Member
0 Kudos

Hi Shruthi,

i have no xslt basic, can give me a sample, how can i parse this xml-file?

Thanks a lot.

Regards

Shuo

Former Member
0 Kudos

Hi jaideep,

i have see the same link, before i post this Thread. but i haven't founded a thread, that the xml-file with dynamic variable.

but thank u for ur link.

regards

Shuo

jaideeps
Advisor
Advisor
0 Kudos

ok...i will try myself and post it..

thanks

jaideep