Below you can find examples of conversions from xstring to string and from string to xstring.

xstring is a hexadecimal type.

      
  data : lv_data  type string,
         lv_datax type xstring.

  lv_data = 'Hello world!'.

  lv_datax = cl_bcs_convert=>string_to_xstring( lv_data ).

  data(lv_reconvert) = cl_bcs_convert=>xstring_to_string( iv_xstr = lv_datax iv_cp = '4110' ).

  write : lv_reconvert.
      
    

Output : Hello world!