Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CALL TRANSFORMATION

Hello.

I am making a small and simple example of a XML transformation.

The transformation i am using is the following:

<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

<tt:root name="ROOT"/>

<tt:template name="tmpl1">

<tt:loop ref=".ROOT" name="a">

<A>

<name>

<tt:value ref="$a.name"/>

</name>

<ZLS>

<tt:loop ref="$a.zls" name="z">

<Z>

<tt:value ref="$z.nummer"/>

</Z>

</tt:loop>

</ZLS>

</A>

</tt:loop>

</tt:template>

</tt:transform>

I can do the transformation from XML to ABAP tables without any problems but when i try to to it the other way (ABAP tables to XML) i get the following dump: CX_INVALID_TRANSFORMATION --> "Type of source and target must always be different for transformation START-OF-SELECTION"

The program i am using is the following:

data: xml_string type string.

data: begin of z,

number type string,

end of z.

data: begin of a,

name type string,

zls like table of z,

end of a.

xml_string = `<A>` &

`<name>A1</name>` &

`<ZLS>` &

`<Z>01</Z>` &

`<Z>02</Z>` &

`</ZLS>` &

`</A>` &

`<A>` &

`<name>A2</name>` &

`<ZLS>` &

`<Z>03</Z>` &

`</ZLS>` &

`</A>`.

CALL TRANSFORMATION ZMY_FRIST1

SOURCE XML xml_string

RESULT ROOT = t_a.

CALL TRANSFORMATION ZMY_FRIST1

SOURCE ROOT = t_a

RESULT XML = xml_string.

I get the dump on the second CALL TRANSFORMATION.

Anyone knows why and what can i do to fix this?

Thank you

Nuno Silva

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question