Skip to Content
avatar image
-1
Former Member

Outbound XML Transformation error in SAP

Hello, I am trying to generate XML. I wrote the following transformation but it is resulting error when referring the XML transformation.

'Error during access to the ref node 'ROOT'. The ref node is not defined or does not have the necessary type'

Transformation as below.

<?sap.transform simple?>
http://www.sap.com/transformation-templates">
<tt:root name="ROOT" />
<tt:template>
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Part_by_Supplier.xsd">
<PartConversion>
<tt:loop name="line" ref=".ROOT">
<CompanyNumber>
<tt:value ref="$line.COMPANYNUMBER"/>
</CompanyNumber>
<Active>
<tt:value ref="$line.ACTIVE" />
</Active>
<CompanyPartNumber>
<tt:value ref="$line.COMPANYPARTNUMBER" />
</CompanyPartNumber>
<SupplierNumber>
<tt:value ref="$line.SUPPLIERNUMBER" />
</SupplierNumber>
<UnitMesaurePart>
<Name tt:value-ref="$line.UNITMESAUREPART.NAME"/>
<Isocode tt:value-ref="$line.UNITMESAUREPART.ISOCODE"/>
</UnitMesaurePart>
<UnitMeasureConversion>
<Name tt:value-ref="$line.UNITMEASURECONVERSION.NAME"/>
<Isocode tt:value-ref="$line.UNITMEASURECONVERSION.ISOCODE"/>
</UnitMeasureConversion>
<ConversionFactor tt:value-ref="$line.CONVERSIONFACTOR"/>
</tt:loop>
</PartConversion>
</Root>
</tt:template>
</tt:transform>

 Can someone please help. Thank you very much.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Jan 11 at 03:19 PM

    Well, for basic questions like this, I wrote a documentation and provide lots of examples in the documentation that don't have errors.

    https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_st.htm

    Check those ...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 28 at 11:56 PM
    -1

    There are 2 issues. In call transformation, ROOT_NAME is replaced with Transformation root name. It resolved the issue.

    In sending issue, Webservice URL is incorrect. That's corrected in SOAManager and it worked. now. But only problem was we had BOM indicator in XML file and with UTF-16 encoding. That anyway is okay for us. BOM indicator is resolved with disabling <?xml...> completely. Thank you all for your help.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 28 at 11:57 PM
    -1

    There are 2 issues. In call transformation, ROOT_NAME is replaced with Transformation root name. It resolved the issue.

    In sending issue, Webservice URL is incorrect. That's corrected in SOAManager and it worked. now. But only problem was we had BOM indicator in XML file and with UTF-16 encoding. That anyway is okay for us. BOM indicator is resolved with disabling <?xml...> completely. Thank you all for your help.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 12 at 07:27 PM
    -2

    CALL TRANSFORMATION ... SOURCE ROOT = structured_variable

    For my transformations, in CALL TRANSFORMATION xxxxx SOURCE (root name) = data_table RESULT XML xstring.

    I just changed the root name same as my root name in transformation and xstring with type string. It started working.

    If someone tells me the differences for this, it will be helpful.

    Add comment
    10|10000 characters needed characters exceeded

    • Obviously, your root names must match. I guess you don't need an explanation for that.

      We can't answer for the type string versus xstring, because you didn't post your ABAP code. The only difference within CALL TRANSFORMATION is that an XSTRING means UTF-8 encoding, while a STRING is not converted (by definition, a STRING has the same encoding as the one of your system, some UTF-16/UCS-2, with variation on the endianness).

  • avatar image
    Former Member
    Jan 11 at 03:00 PM

    Hello,

    I believe the syntax is not correct. It should be like below:

    <tt:root name="ROOT" type="?"/>

    <tt:root name="DOCUMENTS" type="ddic:ZADV_CORRESPONDENCE"/>

    Please change and let us know if it's helpful.

    Regards,

    Rohit Tiwari

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 12 at 10:13 AM

    I see in your comment that you refer to ZML_S_PARTCONVERSION1, does the S mean that it's a structure, and that you use CALL TRANSFORMATION ... SOURCE ROOT = structured_variable... If that's right, then it means that you should replace structured_variable with an internal table (because you use tt:loop in your transformation). If your variable is a table ITAB with the obsolete header line, then remember to write ITAB[] (with square brackets) to refer to the body of the table, not the header line.

    Add comment
    10|10000 characters needed characters exceeded

    • As explained in the ABAP documentation, the BOM is generated when you store the transformation result into a STRING variable. If you store it into an XSTRING variable, there's no BOM and the encoding is UTF-8.

      PS: in the forum, you have the action "delete" to delete your extra replies.