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: 

Download Japanese text to a text file

Former Member
0 Kudos

Hi All,

Japanese texts(2-byte characters) are stored in a standard text and I'm trying to download this in to a text file locally using FMs WS_DOWNLOAD, GUI_DOWNLOAD but the text are converted into 1 byte characters. Is there other way to download it without being converted? Would this work properly if my PC's OS is Japanese? I already logged on SAP in JA language and changed language setting of my PC but still text are converted.

Thanks in advance!

9 REPLIES 9

Former Member
0 Kudos

Hi,

Please have a look at the class CL_ABAP_CONV_OUT_CE and see if it is possible to do the conversion there.

Have you tried to download the files in binary format? If you have a unicode system that might also work...

Regards, Joerg

0 Kudos

Hi,

I'll check the class you suggested if it works. I also tried with binary format but it is still the same when downloaded.

Thanks,

Mervin

Former Member
0 Kudos

Hi Mervin,

You can display the standard text in the transaction SO10 and there's an option to download the text to a local file. Can you use that ? Or do you want to do it with an ABAP Program ?

Regards,

Anand Mandalika.

0 Kudos

Hi Anand,

I have to do it with an ABAP program. The downloaded file from SAP will be uploaded later for Web Reporting.

Thanks,

Mervin

0 Kudos

Hi Mervin,

I hope you are using the READ_TEXT Function Module (or something similar) to get the text into an internal table. If yes, then did you consider the CODEPAGE parameter of the GUI_DOWNLOAD / WS_DOWNLOAD function module ?

Also have a look at other function module in the function group STXD. And also please verify if the direct download of the text from SO10 is producing a satisfactory result.

Regards,

Anand Mandalika.

0 Kudos

Hi Anand,

Yup, I'm using READ_TEXT to get the text into itab and download the itab contents using WS_DOWNLOAD. I tried considering now the CODEPAGE but still it doesn't work. I used codepage 8000 for Japanese and filetypes ASC, DBF and WK1 but still I got the same result. I didn't find any downloading FM in STXD also.

About SO10, the text ID LTXT is not available from there so I cannot use it. The text is actually a long text in IW53 transaction (Service Notification). I didn't find any download functionality in the transaction screen.

Thanks!

Mervin

0 Kudos

Hi,

Uh-oh. You shouldn't have called it a <i>standard text</i> in that case. Anyways, that's okay.

Now are you referring to the text from the text-edit area in the IW53 transaction ? In that case, all you need to do is to right-click the mouse. You've got the option <i>Save as local file</i> on the context menu.

Regards,

Anand Mandalika.

0 Kudos

Hi Anand,

Sorry for the wrong term I used 😃 I tried downloading the long text from the sapscript-editor in IW53. There's a download functionality from the Menu and from there, the ff. file types are available: RTF, ASCII, ITF and HTML. RTF works fine actually but the rest is not. It uses FM EXPORT_TEXT to download to local file. Unfortunately, I cannot use RTF because the file that I will be downloading should be tab delimited and it also contains other data such as date, notification nr, etc. Long text is only placed at the last column in the file.

For ASCII type, there's an option to put codepage but japanese are still converted. When i pasted a japanese character in notepad and saves it, it advises to change encoding to "Unicode". This can be done when doing "Save as". Unfortunately, the EXPORT_TEXT FM doesn't have this "Encoding" option. Do you think this is really possible?

Many thanks!

Mervin

0 Kudos

Hi Mervin,

Have you had a chance to look at the documentation for the Function Module EXPORT_TEXT ? The parameters are all very well documented. If you are logged on in Japanese, then please log on in English :-).

Regards,

Anand Mandalika.