File Download
Use
You can export files with FileDownload, which fulfils the usual security requirements (see FileDownload). This download functionality is available in every action handler, for example, when clicking a button, a LinkToAction or (what you should not do) when switching a TabStrip or clicking a RadioButton.
When the user clicks the respective UI element, a binary data stream is generated. For this data stream, the appropriate URL is generated and the result is displayed in a separate browser window.
Features
For both cases, whether to export a single file or several files, the same ways of displaying and storing the file(s) exist:
- Display in the same window
Example:

- Save query in the same window
Example:

- Display in a separate window
- Save query in a separate window
Activities
Use the method ATTACH_FILE_TO_RESPONSE of class CL_WD_RUNTIME_SERVICES for the file export.
Example
For an example for the file export via a button, see the component WDR_TEST_EVENTS in the view button. The area to the right contains the test example for all eight cases in the bottom group.