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: 

Downloading file in UTF-8 format

Former Member
0 Kudos

Hi,

I want to download a file in UTF-* format.

i have written the following code to download it in UTF-8.

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

LOOP AT p_struct INTO w_struct.

TRANSFER w_struct TO l_filename.

CLEAR w_struct.

ENDLOOP.

CLOSE DATASET l_filename.

my question how do i check the file whether it is been downloaded in UTF-8 or not?

Thanks in advance.

neha

7 REPLIES 7

Former Member
0 Kudos

Hi,

you can check if a file a UTF-8 file is with the method CHECK_UTF8 of the class CL_ABAP_FILE_UTILITIES.

Regards,

Gianpietro

0 Kudos

hi,

When i checked using that method the file is in ANSI format. how do i convert my file to UTF-8 format while downloading. i think the above code which iam using is not working. can you send me a sample code of downloading a file in utf-8 format.

neha

0 Kudos

Hi neha,

you can use GUI_DOWNLOAD function for the same.

Hope this wil help you.

~ Ramanath.

0 Kudos

Hi,

mh...

My programm do it at the same kind as yours,

OPEN DATASET filename IN TEXT MODE FOR OUTPUT ENCODING UTF-8

...

I have to thing about this..

0 Kudos

Hi,

sorry, which value returns cl_abap_file_utilities=>check_UTF8( ...parms... ) exactly ?

0 Kudos

Hello Gianpietro

Have a look at the <b>constants </b>(tabstrip <i>Attributes</i>) of this class. There you should find the values that are returned.

Regards

Uwe

0 Kudos

Hi uwe,

yes, but i mean wich value returns the method call if niha check his file...

Regards,

Uwe..