on 10-22-2008 4:48 PM
Hi All,
I need to convert the XSTRING to STRING and i need a FM which converts all the special characters as it is.
Im getting the xstring value from excel sheet using file upload.
The FM used is CL_HTMLB_FILEUPLOAD and the attribute is FILE_CONTENT which is of type XSTRING.
I have few special characters in the excel sheet which i need as string.
Can anyone suggest me...
Thanx in advance
Siva.
Try this function module ECATT_CONV_XSTRING_TO_STRING.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siva,
Write your own own method or function module like this:
Input : input_rawstr
Output : output_str
start of code ****
DATA: obj TYPE REF TO cl_abap_conv_in_ce,
len type int4.
TRY.
CALL METHOD cl_abap_conv_in_ce=>create
EXPORTING
input = input_rawstr
encoding = 'UTF-8'
replacement = ''
RECEIVING
conv = obj.
CATCH cx_parameter_invalid_range .
CATCH cx_sy_codepage_converter_init .
ENDTRY.
len = xstrlen( input_rawstr ).
TRY.
CALL METHOD obj->read
EXPORTING
n = len
IMPORTING
data = output_str.
CATCH cx_sy_conversion_codepage .
CATCH cx_sy_codepage_converter_init .
CATCH cx_parameter_invalid_type .
CATCH cx_parameter_invalid_range .
ENDTRY.
end of code ******
Best Regards,
Siva.
Edited by: Siva Rama Krishna J on Oct 23, 2008 11:21 AM
CL_BCS_CONVERT=>xstring_to_string(
EXPORTING
iv_xstr = lv_xstring_var
iv_cp = 1100 " SAP character set identification
RECEIVING
rv_string = DATA(lv_string)
).
IF sy-subrc = 0.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Thanx for all ur replies.
I have solved the issue.
First convert the xstring to binary. SCMS_XSTRING_TO_BINARY
Then binary to string.
SCMS_BINARY_TO_STRING
It works fine.
Thank u.
Siva.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.