Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

xstring conversion

Former Member
0 Kudos

Hi ,

I receive text from Portal as xstring . Now in R/3 I need to save this as a standard text .

I can convert xstring to binary .. but how do i convert it to text to be saved as standard text.

Any idea?

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos

try this which will convert the xstring to text string


data: l_convin   type ref to cl_abap_conv_in_ce,
      l_msgstr   type string ,
      l_text type xstring,
      l_html type string .

 try.
               call method cl_abap_conv_in_ce=>create
                 exporting
                   encoding = 'UTF-8'
                   input    = l_text " xstring content received from portal
                 receiving
                   conv     = l_convin.

               call method l_convin->read
                 importing
                   data = l_html.

             catch cx_root.
               l_msgstr = 'Conversion error'.
           endtry.

3 REPLIES 3

athavanraja
Active Contributor
0 Kudos

try this which will convert the xstring to text string


data: l_convin   type ref to cl_abap_conv_in_ce,
      l_msgstr   type string ,
      l_text type xstring,
      l_html type string .

 try.
               call method cl_abap_conv_in_ce=>create
                 exporting
                   encoding = 'UTF-8'
                   input    = l_text " xstring content received from portal
                 receiving
                   conv     = l_convin.

               call method l_convin->read
                 importing
                   data = l_html.

             catch cx_root.
               l_msgstr = 'Conversion error'.
           endtry.

0 Kudos

Thanks a ton for ur help . It works

0 Kudos

hi

guru.

The above process is for converting xstring to string if possible can u give some info on converting x to c .