‎2007 Jul 03 5:07 PM
Hi,
How I get the binary text of an picture?
I want to transfer it in a xml file
Regards,
‎2007 Jul 03 5:12 PM
Hi
Check the Tcode
SMW0
to convert to Binary
Reward points for useful Answers
Regards
Anji
‎2007 Jul 03 5:12 PM
Hi
Check the Tcode
SMW0
to convert to Binary
Reward points for useful Answers
Regards
Anji
‎2007 Jul 03 6:19 PM
Helo Darley...
How are you??
Did you try to use the command open dataset? It has a property binary mode.
Try this and let me know what happened.
Regards
Mineiro
‎2007 Jul 03 9:44 PM
Good idea Mineiro,
I got de bytes of a image with GUI_UPLOAD function.
but i want send this image in a xml message.
According with w3c, this images must be in a base 64 encoded image.
‎2007 Jul 04 12:20 PM
‎2007 Jul 04 1:35 PM
Solved
TYPES: BEGIN OF y_byte,
byte(65534) TYPE x,
END OF y_byte.
DATA: o_encryptor TYPE REF TO cl_hard_wired_encryptor,
t_bytes TYPE TABLE OF y_byte,
wa_byte LIKE LINE OF t_bytes,
v_byte_array TYPE xstring,
v_encoded_bytes TYPE string.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:Sunset.jpg'
filetype = 'BIN'
TABLES
data_tab = t_bytes.
CREATE OBJECT o_encryptor.
LOOP AT t_bytes INTO wa_byte.
CONCATENATE v_byte_array wa_byte-byte INTO v_byte_array IN BYTE MODE.
ENDLOOP.
v_encoded_bytes = o_encryptor->base64_encode( v_byte_array ).
‎2007 Jul 04 1:42 PM
the steps you would need.
1. gui_upload with 'BIN' as file type which would result in a image content in Binary table.
2. use FM SCMS_BINARY_TO_STRING to convert this binary to string
3. use CL_HTTP_UTILITY=>IF_HTTP_UTILITY~ENCODE_BASE64 method to encode the string to base64.
4. now you can use this string to set it in XML