Conversions : XSTRING to STRING

PARAMETERS : str TYPE string.
DATA : xstr TYPE xstring,
       strc TYPE string.
" converting string to xstring *
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
  EXPORTING
    text   = str
  IMPORTING
    buffer = xstr.
WRITE :/ 'string:', str.
WRITE :/ 'xstring:',xstr.
ULINE.
" converting xstring to string *
CALL METHOD cl_abap_conv_in_ce=>create
  EXPORTING
    input = xstr    " Input Buffer (X, XSTRING)
  RECEIVING
    conv  = DATA(lr_conv).

lr_conv->read(
  IMPORTING
    data    = strc ).    " Data Object To Be Read

WRITE :/ 'xstring:', xstr.
WRITE :/ 'string:',strc.


Serkan AKKAVAK
Computer Engineer
SAP Department Deputy Manager
Contact : serkurumsal@yandex.com