Many times over the years customers have asked for reports to be sent in Excel format, and of course there are various approaches for generating such files. Traditionally, however, it has always been a bit painful to generate beautifully formatted reports for Word or Excel. In this blog I will explain how Floe can be used to generate reports that can be consumed by many different applications and devices.
Floe is an email generator, so not the obvious choice as a reporting tool. But using Floe you can easily generate files for emails or for other documents using a simple html template.
Let’s consider a simple example.

Here is a table defined in Floe Email Builder:

We can see that there is a header row and the a repeating row containing some variables.

Data user-exit

Then we add some code in the email data user-exit in the SAP back-end:

Copy to Clipboard

Here we perform the database selection into an internal table, and then convert that table into Floe variables using method /floe/core=>get_data_from_table.

Now we’re ready to start testing.

Using the Preview and Test view in Floe Email Builder, preview the email type and see the simple report in the app:

If we send the email, then the report can be viewed in the email client – it works on any mobile device, web-based client, or in Outlook.

Generating the report as an attachment.

We can turn the Floe report output into a document. The easiest way to do this is to define a second Floe email type, and use the ‘Attachment’ user-exit for the document generation.
Here we call the Floe API function, with the preview flag set, and then convert the output to an xstring, then append this to the attachments parameter:

Copy to Clipboard

Now when we trigger Floe to send the email, the first email appears as an attached document within the second email:

Double-click on the attachment to open it using the default browser. This will work on any device:

If you save the attachment locally it can be opened (and freely edited) in Excel and Word:

So, for an email generator, Floe is remarkably versatile! A simple email, which took 15 minutes to develop, can create a report that can be seamlessly consumed from SAPGUI, Fiori, any email client, any browser, Excel and Word.