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: 

Writing Chinese characters in application server file

Former Member
0 Kudos

Hi,

I have data in my internal table like columnwise as dsiplayed below :

mandt ebeln ebelp matnr maktx menge meins

When I try to write the data into application server text file it is showing correct data as per columnwise for English text.

But if "maktx" field have chinese characters in it then it shifts next column to the right with addition of some blnk spaces in field "maktx".

Can you please let me know how to solve this problem?

Regards

Vikram

5 REPLIES 5

Former Member
0 Kudos

Hi,

Please open the text file with MS Excel and then save the file as Unicode Text (Not Tab delimited Text), Now try to upload the same in Application server.

Regards,

Narayan

0 Kudos

Still it is having the same problem.

I am directly transferring data from internal table to application server text file.

For this is there any option for chinese chars??

0 Kudos

Hi,

Can you provide the part of code you have written for 'Open Dataset'?

Regards,

Narayan

0 Kudos

data: datpfad4(128) type c.

OPEN DATASET datpfad4 FOR OUTPUT IN TEXT MODE ENCODING UTF-8.

loop at itab.

transfer itab to datpfad4.

endloop.

CLOSE DATASET datpfad4.

0 Kudos

Do you have a SAP Unicode system? Otherwise, what kind of installation is it? (MDMP, blended...)

If it's a SAP Unicode system, and you write the file using UTF-8 format, then it guarantees that there is no issue with characters.

What the problem is, maybe, is that the software you use to read the file doesn't recognize that the file is in UTF-8 format. When you open it you have the possibility to determine the encoding. A better option is to add a Byte Order Mark (BOM) at the beginning of the file. For UTF-8, it corresponds to 3 bytes (hex EFBBBF). Recent softwares are able to detect it. Note that Microsoft Office softwares are best suited for UTF16-LE format. You may add the BOM using OPEN DATASET keyword.