Gurus,
I am trying to E-mail an XML file, to do so I am converting ABAP Internal Table to XML using Syntax
CALL TRANSFORMATION ZXMLF
SOURCE dataset = gt_final
RESULT XML xml_out.
Here xml_out is of type string.
So I am converting xml_out to xstring using FM SCMS_STRING_TO_XSTRING and thereafter
converting the Xstring data to binary using SCMS_XSTRING_TO_BINARY.
And from there I am dispatching the data via E-mail.
The problem is when I recieve the E-mail and open the file it gives error as shown in the screenshot.
and when I edit the file and change the encoding
encoding="utf-16" to encoding="utf-8" it works fine. Now I do realize that if I use the xml_out type as xstring I will get encoding 8 by default.. but that doesn't work either though the attached file contains encoding 8.. It gives the same error as above screenshot.. Please guide me how to fix this
Also please find the CALL TRANSFORMATION ID
<?sap.transform simple?>
<?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="DATASET" type="ddic:Z_LINETYP"/>
<tt:template>
<DATASET>
<tt:loop ref=".DATASET">
<Y_XML1>
<BUKRS tt:value-ref="BUKRS"/>
<MONAT tt:value-ref="MONAT"/>
<GJAHR tt:value-ref="GJAHR"/>
<AUFNR tt:value-ref="AUFNR"/>
<PO_NO tt:value-ref="PO_NO"/>
<PO_ITEM tt:value-ref="PO_ITEM"/>
<PO_VALUE tt:value-ref="PO_VALUE"/>
<GR_AMT tt:value-ref="GR_AMT"/>
<INV_AMT tt:value-ref="INV_AMT"/>
<AUC_AMT tt:value-ref="AUC_AMT"/>
<FNL_ASSET tt:value-ref="FNL_ASSET"/>
<CAP_AMT tt:value-ref="CAP_AMT"/>
</Y_XML1>
</tt:loop>
</DATASET>
</tt:template>
</tt:transform>