2023 Mar 21 2:55 PM
Hello Experts,
I have problem with transformation (STRANS), header is passing to the structure but the table by loop unfortunately not. When I CALL TRANSFORMATION the values from Confirmation (Name1, NrRef, Id, Sk, Na, Code) save to structure as RESULT of transformation but the position from Document unfortunately not.
My XML:
My transformation:
<?sap.transform simple?><br><tt:transform
xmlns:tt="http://www.sap.com/transformation-templates"
xmlns:ddic="http://www.sap.com/abapxml/types/dictionary"
xmlns:def="http://www.sap.com/abapxml/types/defined">
<br><tt:root name="Confirmation" type="ddic:ZTEST_XML"/><br>
<tt:template><br>
<Confirmation xmlns="http://........../v1"><br>
<Name1 tt:value-ref=".Confirmation.Name1"/><br>
<NrRef tt:value-ref=".Confirmation.NrRef"/><br>
<Id tt:value-ref=".Confirmation.Id"/><br>
<Sk tt:value-ref=".Confirmation.Sk"/><br>
<Na tt:value-ref=".Confirmation.Na"/><br>
<Code tt:value-ref=".Confirmation.Code"/><br>
<Document><br>
<tt:loop ref=".Confirmation.Document"><br>
<NrDok tt:value-ref="NrDok"/><br>
<NrInv tt:value-ref="NrInv"/><br>
<DatSend tt:value-ref="DatSend"/><br>
<DatReg tt:value-ref="DatReg"/><br>
<SkDok tt:value-ref="SkDok"/><br>
</tt:loop><br>
</Document><br>
</Confirmation><br>
</tt:template><br>
</tt:transform>
Defined structures:
ZTEST_XML is structure like
Name1 Types String<br>
NrRef Types String<br>
Id Types String<br>
Sk Types String<br>
Na Types String<br>
Code Types String<br>
Document Types ZTEST_TT_DOCUMENT<br>
ZTEST_TT_DOCUMENT is Table Type with line type:
NrDok Types String<br>
NrInv Types String<br>
DatSend Types String<br>
DatReg Types String<br>
SkDok Types String
2023 Mar 21 8:40 PM
You did:
<Document>
<tt:loop ref=".Confirmation.Document">
...
</tt:loop>
</Document>
But it should be: <tt:loop ref=".Confirmation.Document">
<Document>
...
</Document>
</tt:loop>
2023 Mar 21 7:55 PM
So, your question is about the programming language Simple Transformation (a transformation can also be in language XSLT), and you want to deserialize XML into a complex structure where one component is an internal table.
You have lots of <br> tags in your pasted code. Maybe if you use Ctrl+Shift+V (instead of Ctrl+V), you'll avoid all these <br>.
2023 Mar 21 8:40 PM
You did:
<Document>
<tt:loop ref=".Confirmation.Document">
...
</tt:loop>
</Document>
But it should be: <tt:loop ref=".Confirmation.Document">
<Document>
...
</Document>
</tt:loop>
2023 Mar 22 7:05 AM