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

SAP transformation

Former Member
0 Likes
1,492

Hi,

Is there any standard SAP transformation to convert XML string to ABAP internal table.

Thanks,

Shiva

Hi,

Is there any standard SAP transformation to convert XML string to ABAP internal table.

Thanks,

Shiva

10 REPLIES 10
Read only

Former Member
0 Likes
1,459

Here it is [!!!!!|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=convertXMLstringtointernal+table&adv=false&sortby=cm_rnd_rankvalue]

Read only

Former Member
0 Likes
1,459

Hi,

[;

[;

[;

Read only

Former Member
0 Likes
1,459

HI you can refer this program

<<Copy and paste answer removed, along with a few points>>

Hope it will help you.

regards,

Lokesh

Edited by: Matt on Jan 29, 2009 9:34 AM

Read only

0 Likes
1,459

>

> HI you can refer this program

..And you can refer [this|http://blog.itpub.net/post/538/476696] Link.

Read only

0 Likes
1,459

Tirupati,

Thanks for ur quick reply.

Here u r using 'z_xml_to_abap' -> Cutomized transformation to perticular XML.

I need Standard SAP' s transformation to convert XML to ABAP Internal table, it will be work for any XML.

Thanks,

Shiva

Read only

0 Likes
1,459

Amit,

I really appreciate your generic reply.

I already searched forums. thats why i mentioned STANDARD SAP TRANSFORMATION.

In all forums they are using their own transformations.

Plaese check.

Thanks,

Shiva

Read only

0 Likes
1,459

Are you looking for the "ID" transformation : http://help.sap.com/abapdocu/en/ABENABAP_XSLT_ASXML.htm

For example:

DATA : BEGIN OF l_x2,
     AAAA type string,
   END OF l_x2.
DATA l_xml TYPE string.
l_xml = '<?xml version="1.0" encoding="iso-8859-1"?><asx:ab'
& 'ap xmlns:asx="http://www.sap.com/abapxml" ver'
& 'sion="1.0"><asx:values><ZZZ><AAAA>Value1</AAAA></ZZZ>'
& '</asx:values></asx:abap>'.
CALL TRANSFORMATION id
    SOURCE XML l_xml
    RESULT zzz = l_x2.
ASSERT l_x2-aaaa = 'Value1'.

Read only

0 Likes
1,459

For an internal table, the following code creates 2 lines in lt_xxx :

DATA lt_xxx TYPE TABLE OF t000.
l_xml = '<?xml version="1.0" encoding="iso-8859-1"?><asx:ab'
& 'ap xmlns:asx="http://www.sap.com/abapxml" ver'
& 'sion="1.0"><asx:values><ZZZ><item><MANDT>100</MANDT>'
& '<MTEXT>Ref</MTEXT></item><item><MANDT>200</MANDT>'
& '<MTEXT>sandbox</MTEXT></item></ZZZ>'
& '</asx:values></asx:abap>'.
CALL TRANSFORMATION id
    SOURCE XML l_xml
    RESULT zzz = lt_xxx.
ASSERT lines( lt_xxx ) = 2.

Read only

0 Likes
1,459

..And you can refer this Link.

Being the author of this article, I don't really like it to be quoted in full without any link or reference to the original.

But the link you've posted here leads only to a Chinese copyright infringement. It would be good to remove it as well.

Best wishes,

Jan

Read only

Former Member
0 Likes
1,459

Hi,

There is a good example Just check it..

Regards

Anki Reddy