‎2020 Nov 30 4:26 PM
Hi all,
With this Transformation :
<?sap.transform simple?>
<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">
<tt:root name="ROOT" type="?"/>
<tt:root name="CRPROD_FILE" type="ddic:ZTT_XML_CROF"/>
<tt:template>
<tt:loop ref=".CRPROD_FILE">
<CRPROD_FILE>
<FNAME tt:value-ref="CROF_FIC.FNAME"/>
<ZLOGID tt:value-ref="CROF_FIC.ZLOGID"/>
<ZNBPROD tt:value-ref="CROF_FIC.ZNBPROD"/>
<PROD_ORDER>
<AUFNR tt:value-ref="CROF_HD.AUFNR"/>
<GSTRP tt:value-ref="CROF_HD.GSTRP"/>
<GLTRP tt:value-ref="CROF_HD.GLTRP"/>
<GLTRI tt:value-ref="CROF_HD.GLTRI"/>
<MATNR tt:value-ref="CROF_HD.MATNR"/>
<MENGE tt:value-ref="CROF_HD.MENGE"/>
<MENGE1 tt:value-ref="CROF_HD.MENGE1"/>
</PROD_ORDER>
</CRPROD_FILE>
</tt:loop>
</tt:template>
</tt:transform>
And this File in input :
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CRPROD_FILE>
<FNAME>FILE_TST.xml</FNAME>
<ZLOGID>TSTID</ZLOGID><ZNBPROD>1</ZNBPROD><PROD_ORDER><AUFNR>900001005861</AUFNR><GSTRP>20200713</GSTRP><GLTRP>2020717</GLTRP><GLTRI>2020714</GLTRI><MATNR>101061</MATNR><MENGE>10</MENGE><MENGE1>10</MENGE1></PROD_ORDER></CRPROD_FILE>
We got the "Error accessing the ref. node 'CRPROD_FILE'".
What is wrong ?
‎2020 Nov 30 7:41 PM
There are two possible solutions, depending on what you want to achieve:
‎2020 Nov 30 7:41 PM
There are two possible solutions, depending on what you want to achieve:
‎2020 Dec 01 8:50 AM
Hi Sandra,
Its the second time you help me, thanks for your reply !
I changed it with the second way ZST_XML_CROF structure (instead of ZTT_XML_CROF table)
<?sap.transform simple?>
<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">
<tt:root name="ROOT" type="?"/>
<tt:root name="CRPROD_FILE" type="ddic:ZST_XML_CROF"/>
<tt:template>
<CRPROD_FILE>
<FNAME tt:value-ref="CRPROD_FILE.CROF_FIC.FNAME"/>
<ZLOGID tt:value-ref="CRPROD_FILE.CROF_FIC.ZLOGID"/>
<ZNBPROD tt:value-ref="CRPROD_FILE.CROF_FIC.ZNBPROD"/>
<PROD_ORDER>
<AUFNR tt:value-ref="CRPROD_FILE.CROF_HD.AUFNR"/>
<GSTRP tt:value-ref="CRPROD_FILE.CROF_HD.GSTRP"/>
<GLTRP tt:value-ref="CRPROD_FILE.CROF_HD.GLTRP"/>
<GLTRI tt:value-ref="CRPROD_FILE.CROF_HD.GLTRI"/>
<MATNR tt:value-ref="CRPROD_FILE.CROF_HD.MATNR"/>
<MENGE tt:value-ref="CRPROD_FILE.CROF_HD.MENGE"/>
<MENGE1 tt:value-ref="CRPROD_FILE.CROF_HD.MENGE1"/>
</PROD_ORDER>
</CRPROD_FILE>
</tt:template>
</tt:transform>
and now i got the "Error accessing the ref. node 'CROF_FIC.FNAME'".How to declare this Node ?
‎2020 Dec 01 5:56 PM
Please use the COMMENT button for comments, questions, adding details, replying to OP comment, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.
‎2020 Dec 01 6:01 PM
I think the issue is more about the starting point of VALUE-REF. You should start from the root using a dot. And you could reduce the size of the names with tt:ref:
<?sap.transform simple?>
<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">
<tt:root name="ROOT" type="?"/>
<tt:root name="CRPROD_FILE" type="ddic:ZST_XML_CROF"/>
<tt:template>
<CRPROD_FILE tt:ref=".CRPROD_FILE"> <!-- =============== here -->
<FNAME tt:value-ref="CROF_FIC.FNAME"/>
<ZLOGID tt:value-ref="CROF_FIC.ZLOGID"/>
<ZNBPROD tt:value-ref="CROF_FIC.ZNBPROD"/>
<PROD_ORDER tt:ref="CROF_HD"> <!-- =============== and here -->
<AUFNR tt:value-ref="AUFNR"/>
<GSTRP tt:value-ref="GSTRP"/>
<GLTRP tt:value-ref="GLTRP"/>
<GLTRI tt:value-ref="GLTRI"/>
<MATNR tt:value-ref="MATNR"/>
<MENGE tt:value-ref="MENGE"/>
<MENGE1 tt:value-ref="MENGE1"/>
</PROD_ORDER>
</CRPROD_FILE>
</tt:template>
</tt:transform>