Skip to Content
author's profile photo Former Member
Former Member

For converting text to binary and vice versa

Hi,

I need to convert the TEXT to Binary at the time of saving and from Binary to Text when display to users . I am using different context nodes with elements.

Is it any method to convert both text and binary to the context.

Thanks in advance.

dav

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 19, 2008 at 03:59 AM

    Hi,

    you can use the class cl_abap_conv_out_ce and cl_abap_conv_in_ce to convert text to binary & vice versa.

    Shruthi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      String to Binary

      data:

      convout type ref to cl_abap_conv_out_ce.

      data: lv_string type string,

      lv_binarystring type xstring.

      call method cl_abap_conv_out_ce=>create

      receiving

      conv = convout.

      call method convout->write

      exporting

      • N =

      data = lv_string.

      call method convout->get_buffer

      receiving

      buffer = lv_binarystring.

      Binary to string

      data : lv_binarystring type xstring,

      obj_convin type ref to cl_abap_conv_in_ce,

      lv_string type string.

      call method cl_abap_conv_in_ce=>create

      exporting

      input = lv_binarystring

      receiving

      conv = obj_convin.

      clear lv_string.

      call method obj_convin->read

      importing

      data = lv_string.

      Regards,

      Shruthi R

      Pls reward points if useful

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.