2009 Jan 29 7:51 AM
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
2009 Jan 29 7:52 AM
Here it is [!!!!!|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=convertXMLstringtointernal+table&adv=false&sortby=cm_rnd_rankvalue]
2009 Jan 29 7:54 AM
2009 Jan 29 7:56 AM
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
2009 Jan 29 8:00 AM
>
> HI you can refer this program
..And you can refer [this|http://blog.itpub.net/post/538/476696] Link.
2009 Jan 29 8:05 AM
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
2009 Jan 29 8:08 AM
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
2009 Jan 29 8:55 AM
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'.
2009 Jan 29 11:16 AM
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.
2011 Feb 02 9:35 AM
..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
2009 Jan 29 11:28 AM