2005 Aug 31 1:25 AM
Hi!
How I can convert string to xstring in release 640? because the function SCMS_STRING_TO_XSTRING return the error CMS196 'Error occurred during character conversion'.
Hi!
How I can convert string to xstring in release 640? because the function SCMS_STRING_TO_XSTRING return the error CMS196 'Error occurred during character conversion'.
2005 Aug 31 1:43 AM
2005 Aug 31 8:14 AM
Hi,
maybe you want to try the classes
CL_ABAP_CONV_OUT_CE (string to xstring)
and
CL_ABAP_CONV_IN_CE (xstring to string)
* Sample coding
data: string type string,
xstring type xstring,
lv_length type i,
lorv_conv type ref to cl_abap_conv_out_ce.
string = 'this is a test.'.
clear: lv_length, xstring, lorv_conv.
try.
lorv_conv = cl_abap_conv_out_ce=>create( ).
catch cx_parameter_invalid_range .
* error handling
catch cx_sy_codepage_converter_init .
* error handling
endtry.
try.
call method lorv_conv->write
exporting
* N = -1
data = string
* VIEW =
importing
len = lv_length.
catch cx_sy_codepage_converter_init .
* error handling
catch cx_sy_conversion_codepage .
* error handling
catch cx_parameter_invalid_type .
* error handling
catch cx_parameter_invalid_range .
* error handling
endtry.
try.
call method lorv_conv->get_buffer
receiving
buffer = xstring.
catch cx_root.
* error handling
endtry.
2005 Aug 31 8:19 AM
the function SCMS_STRING_TO_XSTRING uses the same class
(cl_abap_conv_out_ce)
Regards
Raja
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |