Application Development and Automation 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: 
Read only

xstring conversion

Former Member
0 Likes
978

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
Read only

athavanraja
Active Contributor
0 Likes
778

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
Read only

athavanraja
Active Contributor
0 Likes
779

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.

Read only

0 Likes
778

Thanks a ton for ur help . It works

Read only

0 Likes
778

hi

guru.

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