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

Converting asxml back to ABAP structure

Former Member
0 Likes
821

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
797

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.

5 REPLIES 5
Read only

Former Member
0 Likes
797

HI.

TRY

CALL TRANSFORMATION 'ID'

XML_FTAB = XML_TAB

ITAB = IT

REWARD POINTS,

KUMAR

Read only

0 Likes
797

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

Read only

Former Member
0 Likes
798

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>

.

Read only

0 Likes
797

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.

Read only

Former Member
0 Likes
797

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