Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to upload file containing Japanese characters in AL11

Former Member
0 Kudos

Hi All,

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:

#º#®#~#^#ì#q ¼ÓÔ¼·Ï·º

#ì#ç#ß#q ÐÅÐÁÂÞº

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.

STOP.

ENDIF.

ENDLOOP.

endif.

  • Close dataset

CLOSE DATASET pv_name.

Any suggestions on how to resolve this one?

Thanks a lot in advance.

7 REPLIES 7

rainer_hbenthal
Active Contributor
0 Kudos

Why do you use ignoring conversion errors? Thats not helpful.

0 Kudos

I removed the 'ignoring conversion error' and still the output is the same:

#º#®#~#^#ì#q ¼ÓÔ¼·Ï·º

#ì#ç#ß#q ÐÅÐÁÂÞº

µ¶ÞÜ Åµº #¬#ì#@#¼#q

0 Kudos

I didnt said that this will resolve your errors. But using this is the same of ignoring comiler errors....

As you didnt said anything about codepages you're using no help is possible, you didnt mentioned if your SAP system is Unicode, Non-Unicode or even a MDMP system.

You need to figure out which codepage the file has on the presentation server and which codepage your SAP system is using. And it can be that no conversion is possible cause both systems do not have any character in common.

0 Kudos

Our SAP system have Unicode and West European character set checked. Im not sure if this is the codepage you are referring to. If this is not, can you help me out where or what to do to check this codepage.

Thanks.

0 Kudos

you need to check codepages on both system

0 Kudos

check in transaction I18N -> Trouble Shooting --> I18N System Configuration --> F8 - somewhere in the list there's the codepage mentioned ...

0 Kudos

This is what i saw in the transaction. Dont know if this is correct:

Profile parameters

Application servers Profile val.

<wp> : CODEPAGE

All 4103

As for the presentation server codepage, where will I check it?