Conversions : XSTRING to STRING

PARAMETERS str TYPE string.

DATA xstr TYPE xstring.

* converting string to xstring*

CALL FUNCTION ‘SCMS_STRING_TO_XSTRING’

  EXPORTING

  text   str ” pass the string

*   MIMETYPE       = ‘ ‘

*   ENCODING       =

  IMPORTING

    buffer xstr ” get the xstring

 EXCEPTIONS

   FAILED 1

   OTHERS 2.


WRITE :‘string:’str.

WRITE :‘xstring’xstr.

ULINE.

* converting string to string*

data ls_bin type LENGTH 255,

       lt_bin like TABLE OF  ls_bin,

       len type i,

       strc TYPE string.

*converting xstring to binary *

CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’

  EXPORTING

    buffer     xstr

*   APPEND_TO_TABLE       = ‘ ‘

 IMPORTING

    OUTPUT_LENGTH         len

  TABLES

    binary_tab lt_bin.

*converting binary to string *

CALL FUNCTION ‘SCMS_BINARY_TO_STRING’

  EXPORTING

    input_length        len

 IMPORTING

   TEXT_BUFFER         strc

  tables

    binary_tab          lt_bin

 EXCEPTIONS

   FAILED              1

   OTHERS              2.
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