2010 Feb 17 3:12 PM
I'm trying to download XML data using this function module to a local PC file. It contains finnish characters such as Ä.
When I open the XML file with an XML editor, it tells me that "Byte 0xFF found in file ... is invalid for encoding utf-8'
I think I need to save the file with ISO-8859-9 encoding, but I tried to use a codepage for that in the function module, and that also didn't work.
Can anybody suggest what I may be doing wrong?
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_filename
filetype = 'BIN'
write_lf = ' '
* codepage = '1611'
TABLES
data_tab = lt_table.
I'm trying to download XML data using this function module to a local PC file. It contains finnish characters such as Ä.
When I open the XML file with an XML editor, it tells me that "Byte 0xFF found in file ... is invalid for encoding utf-8'
I think I need to save the file with ISO-8859-9 encoding, but I tried to use a codepage for that in the function module, and that also didn't work.
Can anybody suggest what I may be doing wrong?
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_filename
filetype = 'BIN'
write_lf = ' '
* codepage = '1611'
TABLES
data_tab = lt_table.
2010 Feb 17 3:34 PM
Try using the following method:
TRY.
cl_bcs_convert=>string_to_solix(
EXPORTING
iv_string = lv_string
iv_codepage = '1611'
iv_add_bom = 'X'
IMPORTING
et_solix = binary_content
ev_size = size ).
CATCH cx_bcs.
MESSAGE e445(so).
ENDTRY.
For your table run it for every line and append the lines of the 'binary_content' into a collecting table (binary_content_all or something). Play with the BOM (Byte order mark) to see if you need it or not. After the table has been processed you can download the binary_content_all with your function module but I recommend using:
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = l_filename
filetype = 'BIN'
CHANGING
data_tab = binary_content
Let me know if this was helpful!
Cheers,
Roel van den Berge
2010 Feb 17 4:22 PM
2010 Feb 17 4:23 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |