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

Problem Downloading File

Former Member
0 Likes
1,757

Hi Experts,

I have created a simple ABAP Program that reads text file with japanese characters, the requirements is I need to have a comma separator (CSV file doesnt display Japanese Characters, only text file displays it) so I need to manually place a comma separator for them, but the problem is I can view my Japanese Characters correctly but when I use GUI download to save FIle as text file Japanese Characters are not displayed, Can any one suggest on what to do?

Output for GUI download is text file

CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                  = f_upload
      filetype                  = 'ASC'
      has_field_separator       = 'X'
    TABLES
      data_tab                  = i_tab.

* Checks if an error has occured
    IF sy-subrc <> 0.
      WRITE: 'File Open Error'.
    ENDIF.

* Loop in to the contents of Internal Table
    LOOP at i_tab into wa_tab.
      lv_holder = wa_tab.
      lv_name1      = lv_holder(40).
      lv_country    = lv_holder+40(10).
      lv_language   = lv_holder+50(20).
      lv_name2      = lv_holder+70(20).

     CONCATENATE lv_name1 lv_country lv_language lv_name2 INTO wa_output SEPARATED BY lv_comma.

      WRITE: / wa_output.

      MODIFY i_tab FROM wa_output.

      CLEAR: wa_tab.
      CLEAR: lv_holder.
      CLEAR: wa_output.
    ENDLOOP.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename                   = filename
    write_field_separator      = 'X'
  TABLES
    data_tab                   = i_tab.

BR,

LBJ23

Hi Experts,

I have created a simple ABAP Program that reads text file with japanese characters, the requirements is I need to have a comma separator (CSV file doesnt display Japanese Characters, only text file displays it) so I need to manually place a comma separator for them, but the problem is I can view my Japanese Characters correctly but when I use GUI download to save FIle as text file Japanese Characters are not displayed, Can any one suggest on what to do?

Output for GUI download is text file

CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                  = f_upload
      filetype                  = 'ASC'
      has_field_separator       = 'X'
    TABLES
      data_tab                  = i_tab.

* Checks if an error has occured
    IF sy-subrc <> 0.
      WRITE: 'File Open Error'.
    ENDIF.

* Loop in to the contents of Internal Table
    LOOP at i_tab into wa_tab.
      lv_holder = wa_tab.
      lv_name1      = lv_holder(40).
      lv_country    = lv_holder+40(10).
      lv_language   = lv_holder+50(20).
      lv_name2      = lv_holder+70(20).

     CONCATENATE lv_name1 lv_country lv_language lv_name2 INTO wa_output SEPARATED BY lv_comma.

      WRITE: / wa_output.

      MODIFY i_tab FROM wa_output.

      CLEAR: wa_tab.
      CLEAR: lv_holder.
      CLEAR: wa_output.
    ENDLOOP.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename                   = filename
    write_field_separator      = 'X'
  TABLES
    data_tab                   = i_tab.

BR,

LBJ23

12 REPLIES 12
Read only

Former Member
0 Likes
1,475

hi,

mention file type also while uploading data from Internal table to File.

Regards,

Bhavana

Read only

0 Likes
1,475

I thik I have mentioned it already, kindly correct me if Im wrong, thanks

filetype = 'ASC'

Cheers,

LBJ23

Read only

0 Likes
1,475

or one more appropriate question is does GUI_DOWNLOAD Supports Unicode? Thanks

Read only

venkat_o
Active Contributor
0 Likes
1,475

Hi,


CONCATENATE lv_name1 lv_country lv_language lv_name2 INTO wa_output SEPARATED BY lv_comma.
Above specify like wa_output-data . try to change like below.

data: begin of wa_output,
        data TYPE string,
      end of wa_output.

CONCATENATE lv_name1 lv_country lv_language lv_name2 INTO wa_output-data SEPARATED BY lv_comma.
Thanks Venkat.O

Read only

Former Member
0 Likes
1,475

I tried to removed that part of code,

I just simply use straightforward GUI_UPLOAD and GUI_DOWNLOAD,

just wondering if GUI_DOWNLOAD supports Unicode and how can it support

Read only

Former Member
0 Likes
1,475

Hi,

GUI_DOWNLOAD does supports unicode formats. Try using the filetype 'DAT' in the GUI_DOWNLOAD FM and check.

Read only

Former Member
0 Likes
1,475

I have tried using DAT and ASC but it both does not work

Read only

Former Member
0 Likes
1,475

Hi,

Check if the code page for japanese characters is enable in your system. If so mention the same in the CODE PAGE parameter in the GUI_DOWNLOAD FM.

Read only

Former Member
0 Likes
1,475

how can I check it? thanks

Read only

venkat_o
Active Contributor
0 Likes
1,475

Hi,

remove


    write_field_separator      = 'X'

from below code

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename                   = filename
    write_field_separator      = 'X'
  TABLES
    data_tab                   = i_tab.

Thanks

Venkat.O

Read only

Former Member
0 Likes
1,475

japanese is still not displayed on download text file

Read only

Former Member
0 Likes
1,475

HI Leborn23,

for downloading the records, you decleare one internal table like string.

examp:

data: i_tab type standard table of string,

wa_tab type string.

constants: c_comma type char1 value ','.

let you are getting all the records in i_tab1.

now, loop at i_tab into wa_tab1.

concatenate wa_tab1-f1

wa_tab1-f2

into wa_tab

separated by c_comma.

append wa_tab to i_tab.

clear wa_tab.

endloop.

now use

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

    • BIN_FILESIZE =

filename = ' c:/ '

FILETYPE = 'ASC'

    • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = '#'

tables

data_tab = i_tab

Regards,

Tutun