Conversions (2) : 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.


Steps.


 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s