I'm trying to modify a program that extracts a text file from local drive then upload the file to sap directory. The input text file contains Japanese characters. When I view the file created, it looks like the one below:
The code that I am fixing is below:
open dataset pv_name for output in text mode encoding non-unicode
ignoring conversion errors.
open dataset pv_name for output in legacy text mode code page '8000' ignoring conversion errors.
*OPEN DATASET pv_name FOR OUTPUT IN TEXT MODE ENCODING UTF-8 WITH BYTE-ORDER MARK.
if sy-subrc = 0.
LOOP AT pt_input.
TRANSFER pt_input TO pv_name.
IF SY-SUBRC NE 0.
WRITE:/ 'Error writing file'(011), pv_name.
CLOSE DATASET pv_name.
Any suggestions on how to resolve this one?
Thanks a lot in advance.