Unable to write to client during background processing.
The nature of the background processing is that the client machine should not be connected to the WAS.
If file creation is time consuming, you can initiate file creation in WAS and then offer a list of files to download somewhere in your BSP application.
Update:
If you simply provide a file name, the file will be placed in the directory specified by the DIR_HOME profile DIR_HOME . You can check / change profile settings in RZ11 or browse directories in AL11.
For general information on working with files in ABAP, you can refer to http://wiki.sdn.sap.com/wiki/display/ABAP/Working+with+files
second update:
Typically, data loading is achieved by setting the correct HTTP header fields and pushing binary data into the HTTP response.
You should take a look at cl_bsp_utility=>download .
This sets the correct content headers in your answer. You must specify your data (as XSTRING ) and indicate which Content-Type and Content-Disposition you want.
Content-Type is the type of mime file. So, for an Excel file, which could be application/vnd.ms-excel , or you can use something common, like application/octetstream .
Content-Disposition can be used to tell the browser the default file name. An approximate value might be attachment; filename=filexyz.xls attachment; filename=filexyz.xls .
Remember that browsers may have slightly different behavior based on a combination of Content-Type and Content-Disposition (i.e. offering the Save As ... dialog instead of showing it in a line).
source share