on 10-17-2012 9:52 AM
Hi guys,
im uploading a csv file.
But after the upload and splitting the file i have instead of a Ö,Ü,Ä a # in lt_data table.
Here is the part of the coding:
lo_nd_upload = wd_context->get_child_node( name = wd_this->wdctx_upload ).
lo_el_upload = lo_nd_upload->get_element( ).
lo_el_upload->get_static_attributes( IMPORTING static_attributes = ls_upload_node ).
REFRESH lt_bapiret2.
CALL FUNCTION 'LXE_COMMON_XSTRING_TO_STRING'
EXPORTING
in_xstring = ls_upload_node-content
IMPORTING
ex_string = ls_data
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ELSE.
SPLIT ls_data AT cl_abap_char_utilities=>cr_lf INTO TABLE lt_data.
THX
Hello kan,
the file and the SAP system seem to have a different code page. This normal and nothing to worry to about. It seems that the function you use does not perform a code page transformation. The solution to this is to use the CL_ABAP_CONV_IN_CE class instead.
try.
lo_conv = cl_abap_conv_in_ce=>create( encoding = '4103' ). "<= your file code page
*-- Convert file data to string
lo_conv->convert(
exporting input = lv_file
importing data = lv_text ).
catch cx_root.
*-- Conversion error
endtry.
Best regards,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.