‎2008 Jul 11 3:49 AM
Dear All,
Has anyone experience convert excel to binary ?
For example, I have an excel file in my PC then I would like to set it as attachment in mail using CL_DOCUMENT_BCS. Attachment in this class only have two version, as text or as hexadecimal.
In order to create hexadecimal content I need a binary format, i will use function SCMS_BINARY_TO_XSTRING.
The problem is, how to convert excel to binary format.
Thanks in advance.
Rgds,
Deny
‎2008 Jul 11 4:20 AM
Hi,
You can upload the excel file in binary. This can be specified in the upload FM GUI_UPLOAD.
Hope this helps.
‎2008 Jul 11 9:41 AM
Hi Siva,
I tried using FM GUI_UPLOAD, but the excel file contains jibberish character.
Rgds,
Deny
‎2008 Jul 11 9:50 AM
Hi,
The other way is to have a input file which is tab delimited. If the file is tabdelimited, then you can skip the binary conversion
‎2008 Jul 12 12:18 AM
I want to keep format also. Example Font Size, Color and Border line into binary format. Simple analog My Excel template will be convert into binary and could be open on attachment.
Deny
‎2008 Jul 12 5:27 AM
hi....
when you are uploading using gui_upload just check your filetype....
for binary....the file type is diffenrent....e.g for text file it is 'DAT' and for excel its is 'ASC'..so just check....
may be thats the reason you are getting sone jibberish characters...
‎2008 Jul 12 8:08 AM
code snippet .
data: xml_tab1 type solix_tab .
call function 'GUI_UPLOAD'
exporting
filename = filename
filetype = 'BIN'
has_field_separator = ' '
header_length = 0
importing
filelength = size
tables
data_tab = xml_tab1
exceptions
others = 1.
call method document->add_attachment
exporting
i_attachment_type = 'XLS'
i_attachment_subject = atta_sub
i_att_content_hex = xml_tab1.