I want to convert a string into a xstring. I know that there is a function module named "SCMS_STRING_TO_XSTRING"
But since it is not a good habit to use function modules anymore, a class based solution would be my prefered way to go.
I know that there is a class
cl_abap_conv_in_ce
but I can only validate, that this class can convert xstrings into string. I wand to have the reverse case. Does anyone have experience on how to do that class based?
Meanwhile, I found the solution on my own. For people who might be interested:
DATA(lo_conv) = cl_abap_conv_out_ce=>create( ).
lo_conv->write( data = lv_content ).
DATA(lv_xstring) = lo_conv->get_buffer( ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With