01-14-2021 2:37 PM
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
01-14-2021 2:44 PM
01-14-2021 2:52 PM
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.
01-14-2021 3:11 PM
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
01-19-2021 12:28 AM
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