Copyright 2022 - BV TallVision IT

If the process that uses a file is not a background process, files on the presentation server can be addressed as well. Function modules GUI_UPLOAD and GUI_DOWNLOAD allow getting front end data or storing it. Of course these function modules will need a filename to store or retrieve with, which can be obtained with the class builder (trx SE24) for class CL_GUI_FRONTEND_SERVICES.. Maybe it's time to do your coding in Abap Objects ?

A small detail on the CL_GUI_FRONTEND_SERVICES class: if you use it to e.g. determine the current working directory, you will find that it doesn't return the values it produces in test when you are calling it from your abap coding. Add a cl_gui_cfw=>flush( ). to complete your coding.

data lv_filename type string.

CL_GUI_FRONTEND_SERVICES=>DIRECTORY_GET_CURRENT(
      changing CURRENT_DIRECTORY = lv_filename ).
cl_gui_cfw=>flush( ).
concatenate lv_filename 'sap_tables_download.xls' 
  into lv_filename separated by '\'.