Application Development 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: 

Problem with Emails with Excel Attachement

martin_svik2
Participant
0 Kudos
460

Hi,

i have an Z-report where i attach an excel to a email and then send the email.

So far so good: when i open the Excel-Attachement in Outlook i get the following error:

After clicking on "Yes" the excel-sheet opens correctly.

Coding in Z-report looks like below -> i have tried it with different subjectname (parameter i_attachment_subject) -> with 'Verantwortlichkeiten.xlsx" with "Verantwortlichkeiten.xls", and with "Verantwortlichkeiten" (with NO extension). The attachment type (parameter i_attachment_type) in the method add_attachement is only 3 char, so i only can put xls in there.

Whatever i try there, i got the warning message above !

Is there any way to avoid this message and open the attachment directly ??

br Martin

1 REPLY 1

Sandra_Rossi
Active Contributor
0 Kudos
278

This question has been already asked so many times in the forum and elsewhere in the Web. I will give the same answer:

First, if you choose xlsx, then the content must be Office Open XML format (a ZIP file containing mostly XML files with precise names and schemes, etc.) You may use abap2xlsx. If it's what you did, then you must indicate &SO_FILENAME=<file name and extension> in the header, as explained in note 1459896 - BCS: Support for four-digit file name extensions.

Other formats may correspond to extensions csv, txt, etc.