on 05-19-2008 4:44 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the conversion classes as stated, but I find the function modules in function group SCMS_CONV even easier to user (basically wrappers around the suggested conversion classes). The function module names are pretty explanatory as to what they do (ie. binary to text or binary to string/text to binary, etc).
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
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.