‎2010 Nov 03 2:28 PM
Hello Experts,
I need to zip some unicode txt files that exist in the presentation server...
I did the following steps.. but the final result was not good. Utf8 characters were not displaying well..
1) I load the file from server int an HEX internal table
call function 'GUI_UPLOAD'
exporting
FILENAME = gfile2
IMPORTING
FILELENGTH = bytecount
TABLES
DATA_TAB = hex_tab.
2) then i convert the hex_tab to XSTRING
call function 'SCMS_BINARY_TO_XSTRING'
exporting
input_length = bytecount
importing
buffer = content_x
tables
binary_tab = hex_tab.
3)i do the zipping
call method g_zipper->add
exporting
name = file_name
content = content_x.
call method g_zipper->save
receiving
zip = zip.
4)i convert it again to binary and download it...
"convert to table
call function 'SCMS_XSTRING_TO_BINARY'
exporting
buffer = zip
importing
output_length = bytecount
tables
binary_tab = hex_tab."file_tab.
"Save the file
call function 'GUI_DOWNLOAD'
exporting
" bin_filesize = ''
filename = gfile2
filetype = 'BIN'
" CODEPAGE = '4310'
tables
data_tab = hex_tab."
*******************************
but as i told you the greek language does not shown ok... any ideas why ?
‎2010 Nov 04 9:41 AM
Example
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
CHANGING
FILE_TABLE = FILE_N_TAB
RC = WA_INT
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = FULL_PATH
FILETYPE = 'BIN'
IMPORTING
FILELENGTH = FILE_LENGTH
CHANGING
DATA_TAB = file_tab.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
INPUT_LENGTH = FILE_LENGTH
IMPORTING
BUFFER = FILEX
TABLES
BINARY_TAB = file_tab
‎2012 May 11 9:08 AM
hello Dear,
I have the same problem.
function -->
SCMS_BINARY_TO_XSTRING
maybe doesnt take care of the greek characters.
Do you have any solution? - (or any work around?)
I apppreciate your help,
Thanks in advance,
Roxani
‎2012 May 11 9:57 AM
Hi,
I have specified a link below. Even though the question is unanswered, it has details about a class that reads Unicode data. Please try that and post furher for clarifications.
http://scn.sap.com/thread/981746
Regards, Pranav.