2010 Nov 04 11:32 AM
Hi,
I have a file to upload to an internal table and i use GUI_UPLOAD function, i already try with filetype ASC and DAT but the words with CHAR 'Ç' as convert in 'A#' increase one CHAR in line on my internal table.
Anyone could help me.
Thanks and Regards,
Eduardo Paiva
2010 Nov 04 4:15 PM
is your system a unicode system?
what codepage did you enter in the parameters to GUI_UPLOAD?
2010 Nov 04 4:15 PM
is your system a unicode system?
what codepage did you enter in the parameters to GUI_UPLOAD?
2010 Nov 04 4:22 PM
Hello Eduardo
Instead of using the fm it is recommended to use the static method
CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD (Unicode-compatibility). You may give it a try.
Regards
Uwe
2010 Nov 04 4:25 PM
Hello Jürgen,
"is your system a unicode system?"
How can i know that?
"what codepage did you enter in the parameters to GUI_UPLOAD?"
i didn't enter any codepage, in my search a try to find which codepage number i had to put but i can´t find anything
I find a sap note 752835 with the following code, i try to implement but file_open_dialog didn't return codepage:
Code example:
call method cl_gui_frontend_services=>file_open_dialog
EXPORTING
...
WITH_ENCODING = 'X'
...
changing
...
FILE_ENCODING = l_encod
...
.
call function 'GUI_UPLOAD'
exporting
...
CODEPAGE = l_encod
.
Best Regards,
Eduard Paiva
2010 Nov 04 5:16 PM
Hi Eduardo,
what is your SAP version?? try the code page '1160'
regards,
Paulo.
2010 Nov 05 10:25 AM
Hello Paulo,
My version of SAP is 4.7
I fill the function with codepage 1106 and show the results:
GUI_UPLOAD without codepage 1106:
word: SERVIÇO --> SERVIÃ#O
GUI_UPLOAD with codepage 1106:
word: SERVIÇO --> SERVI #O
delete the à and fill with space
Best Regards,
Eduardo Paiva
2010 Nov 05 11:39 AM
Hi Eduardo,
I don't know if you wrote wrong only here or in your abap code too, but the code page is 1160, not 1106.
You can see this number with the FM NLS_GET_FRONTEND_CP
DATA: t_file TYPE STANDARD TABLE OF string.
DATA: v_frontend_cp TYPE cpcodepage,
v_codepage TYPE abap_encod.
CALL FUNCTION 'NLS_GET_FRONTEND_CP'
EXPORTING
langu = sy-langu
* FETYPE = 'MS'
IMPORTING
frontend_codepage = v_frontend_cp
EXCEPTIONS
illegal_syst_codepage = 1
no_frontend_cp_found = 2
internal_or_db_error = 3
others = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
v_codepage = v_frontend_cp.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\temp.txt'
filetype = 'ASC'
codepage = v_codepage
TABLES
data_tab = t_file
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Not sure if it solve your problem.. but try it anyway
Paulo.
2010 Nov 24 3:08 PM
Hello,
In function GUI_UPLOAD i put in codepage 4110 (UTF-8) and it works.
Best Regards,
Eduardo Paiva