‎2008 Oct 30 1:46 PM
Hi All,
From internal table uploaded all content in xls file and attached it in mail and send.
using SO_NEW_DOCUMENT_ATT_SEND_API1 FM.
While opening the attachment file .xls it is showing following error.
"The file you trying to open .xls is in a different format than specified by the file extension."
But if open it the content inside is perfect. But always showing the error give negative impact about the data inside.
How to solve this.
Thanks,
Balamurugan.R
‎2008 Oct 30 1:54 PM
Hi,
please show how do you fill the attachment and do you call the FM.
Regards, Dieter
‎2008 Oct 31 6:46 AM
Hi Dieter,
From internal table using following code create a t_objbin and call FM.
LOOP AT <fs_table> ASSIGNING <fs_line>.
v_index = c_1.
*-- Final table contains selected fields.
DO.
v_len1 = STRLEN( t_objbin ).
ASSIGN COMPONENT v_index OF STRUCTURE <fs_line> TO <fs_fld>.
IF sy-subrc NE 0.
EXIT.
t_objpack-transf_bin = c_x.
t_objpack-head_start = c_1.
t_objpack-head_num = c_0.
t_objpack-body_start = c_1.
DESCRIBE TABLE t_objbin LINES t_objpack-body_num.
t_objpack-doc_type = c_xls.
t_objpack-obj_descr = c_attach.
APPEND t_objpack.
Thanks,
Balamurugan.R
‎2008 Oct 30 2:05 PM
Hi Bala,
Check out the link:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/email%2bfrom%2bsap
This might help you to solve your problem.
Thanks,
Chidanand
‎2008 Oct 31 11:25 AM
Hi Chidanand,
When i attach the XLS internally , if my first column is Created by , in XLS it is showing 50 coulmn. why?
and XLS file format error.
Thanks,
Balamurugan.R