2019 Dec 12 11:11 PM
Hi,
We are trying to write a UTF8 file (with a BOM) on Application Server using ABAP using the following statement:
OPEN DATASET <file> FOR OUTPUT IN TEXT MODE ENCODING UTF-8 WITH BYTE-ORDER MARK IGNORING CONVERSION ERRORS.
While on the unicode environments, this works perfect; however, on non-unicode environments ([a]Netweaver 7.3, app server code page 1100; and [b] Netweaver 7.31, app server code page 1160) the files are produced without BOMs and in the code page matching of the app server.
a) Is this the expected behaviour, that this specification is being ignored "ENCODING UTF-8 WITH BYTE-ORDER MARK"?
b) Is there a workaround for this? Note, the file is large and memory is limited, so using binary and character conversion in memory are not ideal options.
Thanks,
Jay 🙂
2019 Dec 16 9:42 AM
Hi Jay,
please check SAP Note 27 and 788449.
It explains how to use the BOM. So I would suggest trying to create the files with method CREATE_UTF8_FILE_WITH_BOM of class CL_ABAP_FILE_UTILITIES.
Best regards,
Andreas
2019 Dec 16 11:14 AM
I don't see in the documentation that it wouldn't work on a non-Unicode system. Isn't there an issue either in OPEN DATASET or in the documentation?
2019 Dec 16 12:06 PM
True Sandra. I do not think this is an OPEN DATASET issue, because it worked for years. Maybe support can bring some light.
2019 Dec 16 11:12 AM
It looks like that either it's a bug of OPEN DATASET or the ABAP documentation is incomplete. I suggest that you open a ticket at SAP support.