2008 Mar 12 11:47 AM
Hi all!
I've generated the asxml representation of an abap structure.
Now, I want to do the opossite. That is, load the asxml back to the original structure.
How can I achieve this? Isn't there a direct way to do it.
Thank you very much.
2008 Mar 12 1:20 PM
CALL TRANSFORMATION ID
SOURCE XML_FTAB = I_XML
RESULT ITAB = MY_STRUCTURE.
should be
CALL TRANSFORMATION ID
SOURCE XML = I_XML
RESULT ITAB = XML_FTAB.
LOOP AT XML_FTAB INTO MY_STRUCTURE.
ENDLOOP.
assuming that:
I_XML is a reference to if_ixml_document
XML_FTAB is an internal table
The source xml should look something like this:
<asx:abap>
<asx:values>
<ITAB>
<item>
????
</item>
<item>
????
</item>
</ITAB>
</asx:values>
</asx:abap>
.
Hi all!
I've generated the asxml representation of an abap structure.
Now, I want to do the opossite. That is, load the asxml back to the original structure.
How can I achieve this? Isn't there a direct way to do it.
Thank you very much.
2008 Mar 12 11:50 AM
HI.
TRY
CALL TRANSFORMATION 'ID'
XML_FTAB = XML_TAB
ITAB = IT
REWARD POINTS,
KUMAR
2008 Mar 12 12:06 PM
Hi
Sorry. No reward points yet
Please I nead some more info.
The code you gave me has sintax error.
CALL TRANSFORMATION 'ID'
XML_FTAB = XML_TAB
ITAB = IT
So I've tryed this (on a guess)
CALL TRANSFORMATION ID
SOURCE XML_FTAB = I_XML
RESULT ITAB = MY_STRUCTURE.
Still doesn't work.
Can you give me some hints about what I'm doing wrong?
Thank you very much Kumar
2008 Mar 12 1:20 PM
CALL TRANSFORMATION ID
SOURCE XML_FTAB = I_XML
RESULT ITAB = MY_STRUCTURE.
should be
CALL TRANSFORMATION ID
SOURCE XML = I_XML
RESULT ITAB = XML_FTAB.
LOOP AT XML_FTAB INTO MY_STRUCTURE.
ENDLOOP.
assuming that:
I_XML is a reference to if_ixml_document
XML_FTAB is an internal table
The source xml should look something like this:
<asx:abap>
<asx:values>
<ITAB>
<item>
????
</item>
<item>
????
</item>
</ITAB>
</asx:values>
</asx:abap>
.
2008 Mar 12 1:55 PM
Hi!
Your hint was very helpfull.
Just got one question hopping you can help me:
What kind of internal table should be XML_FTAB? an internal table of My_Structure?
Can you help me on some pointers to understant better how this is processed by SAP?
I googled it, but poor info found.
Thank you very much.
2008 Mar 13 9:48 AM
Yes, of course, XML_FTAB should be an internal table of My_Structure. And My_structure should contain the same fields as in the XML document.
Here is a link to a SAP XML jumpstart:
http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/content.htm
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |