2009 Jul 30 9:10 AM
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
2009 Jul 30 9:15 AM
hi,
mention file type also while uploading data from Internal table to File.
Regards,
Bhavana
2009 Jul 30 9:18 AM
I thik I have mentioned it already, kindly correct me if Im wrong, thanks
filetype = 'ASC'
Cheers,
LBJ23
2009 Jul 30 9:23 AM
or one more appropriate question is does GUI_DOWNLOAD Supports Unicode? Thanks
2009 Jul 30 9:22 AM
Hi,
Above specify like wa_output-data .
try to change like below.
CONCATENATE lv_name1 lv_country lv_language lv_name2 INTO wa_output SEPARATED BY lv_comma.
Thanks
Venkat.O
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.
2009 Jul 30 9:24 AM
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
2009 Jul 30 9:28 AM
Hi,
GUI_DOWNLOAD does supports unicode formats. Try using the filetype 'DAT' in the GUI_DOWNLOAD FM and check.
2009 Jul 30 9:30 AM
2009 Jul 30 9:38 AM
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.
2009 Jul 30 9:44 AM
2009 Jul 30 9:45 AM
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
2009 Jul 30 9:49 AM
2009 Jul 30 9:26 AM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |