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: 

Issue in ABAP Excel

0 Kudos

Hello Friends,

I am creating an excel file through ABAP program. I am getting a pop up - "The File format and extension of <filename>.xls don't match. The file could be corrupted or unsafe. Do you want to open it anyway?"

I an using ABAP transformation for creating excel content.

I analyzed the issue and came to know that the pop up is coming because the file format coming from excel transformation is in XML and the file is created in .XLS. But I am not able to convert XML content to XLS.

Can anyone help me in converting the XML content coming from transformation to XLS to avoid the pop up.

Thanks,

Pooja

4 REPLIES 4

0 Kudos

abo
Active Contributor
0 Kudos

If you rename the file with "XLSX" extension, you should be fine: Excel is expecting the "old" binary format with "XLS" and the new "XML" format when opening a "XLSX" file.

Sandra_Rossi
Active Contributor
0 Kudos

It's a frequent Excel issue (not ABAP). I tried to explain the Excel formats and corresponding Excel extensions (and vice versa) here: https://stackoverflow.com/questions/65636855/attach-xlsx-file-in-mail-abap

0 Kudos

Hello

in case you are sending it via Email, a file which you generated with abap2xlsx here you have a problem since you can pass only 3 characters for file. So even if you specify XLSX it will be cut and you end up with XLS instead of a XLSX.

so your attachment in fact is of standard Excel 2007 but the extension is for 2003

you can correct it by passing header information

https://launchpad.support.sap.com/#/notes/1459896

BR

Kairat