1

In our SAP ABAP-based application we have a mail sending functionality. The problem is, it's an old framework and it takes only 3 characters file types for attachments. We now want to send .xlsx files. But the framework only takes first 3 characters so it works with .xls. So when a user opens an attachment he gets the following message:

The file you are trying to open, 'xxxxxxxxxxxxx.XLS', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?

enter image description here

Now, I know one solution is to go to Trust center and hide that kind of messages. The another framework that generates the .xlsx files can only generate .xlsx. But I can enhance it.

My question is: in the Excel file structure (when extracted via 7zip), is there somewhere an information about what kind of file (filetype) in the file I just extracted?

Because if the message in the Excel is shown, I can imagine that there is a check that checks filetype of a file and some information in xml files in the Excel file structure.

Thanks.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
miskohut
  • 957
  • 1
  • 14
  • 34
  • 2
    "I can imagine that there is a check that checks filetype of a file and some information ... in the excel file structure." Yes there is. But a `*.xls` file normally does not contains any XML but is a binary file in `BIFF` format. Only `*.xlsx` files are ZIP files containing XML files. So the Excel check does the following: If a file comes as `*.xls` but is not a binary file in `BIFF` format, then do warning. – Axel Richter Jul 04 '18 at 11:13
  • Yep, Alex is right, old `xls` is binary, whist `xlsx` is xml. I assume you cannot omit this warning as you cannot modify binary. – Suncatcher Jul 04 '18 at 11:23
  • Just change the framework. What tool do you use for sending? – Suncatcher Jul 04 '18 at 11:24
  • You are saying that your SAP system is "an old framework and it takes only 3 characters file types for attachments" so it looks like you have created an ABAP program without looking at the [SAP note 1459896 - BCS: Support for four-digit file name extensions](https://me.sap.com/notes/1459896) for adding the email attachment. Note that Excel requires that if you open a file with the `.xlsx` extension, your [Excel file should also be containing data formatted according to Office Open XML for Excel](https://en.wikipedia.org/wiki/Microsoft_Excel#File_formats), otherwise you'll get an Excel warning. – Sandra Rossi Jun 17 '23 at 08:29

0 Answers0