Application Development and Automation 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: 
Read only

ASCII file type with codepage conversion

Former Member
0 Likes
1,990

Hi,

My requirement is to download text file in ASCII file format and there is chinese character which also has to be consider.

For this i am using GUI DOWNLOAD------> file type ASCII--------> codepage '4110'.

CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING
      filename                  = l_file_name
      filetype                  = 'ASC'                                          
      trunc_trailing_blanks     = ' '
      trunc_trailing_blanks_eol = ' '                                                   

      write_field_separator     = 'X'
     codepage                  = '4110'                                                

     write_bom                 = 'X'
    TABLES
      data_tab                  = gt_output.

when i use code page as '4110' it wont convert file type as ASCII.

kindly help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,314

Do not try to create ascii format file.

Chinese characters will be lost. Try binary format and unicode encoding.

As a simple test, open Notepad, paste chinese characters and try saving it as ascii text.

You will get warning that characters will be lost.

If you ignore the warning and save, reopening the file won't show you correct characters.

EDIT: Comment out the filetype = 'ASC' line and retry.

/.

Hi,

My requirement is to download text file in ASCII file format and there is chinese character which also has to be consider.

For this i am using GUI DOWNLOAD------> file type ASCII--------> codepage '4110'.

CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING
      filename                  = l_file_name
      filetype                  = 'ASC'                                          
      trunc_trailing_blanks     = ' '
      trunc_trailing_blanks_eol = ' '                                                   

      write_field_separator     = 'X'
     codepage                  = '4110'                                                

     write_bom                 = 'X'
    TABLES
      data_tab                  = gt_output.

when i use code page as '4110' it wont convert file type as ASCII.

kindly help.

1 REPLY 1
Read only

Former Member
0 Likes
1,315

Do not try to create ascii format file.

Chinese characters will be lost. Try binary format and unicode encoding.

As a simple test, open Notepad, paste chinese characters and try saving it as ascii text.

You will get warning that characters will be lost.

If you ignore the warning and save, reopening the file won't show you correct characters.

EDIT: Comment out the filetype = 'ASC' line and retry.

/.