Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Mail xls open error.

0 Likes
572

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

4 REPLIES 4
Read only

Former Member
0 Likes
546

Hi,

please show how do you fill the attachment and do you call the FM.

Regards, Dieter

Read only

0 Likes
546

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

Read only

Former Member
0 Likes
546

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

Read only

0 Likes
546

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