2018 Oct 26 2:43 PM
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
EXPORTING
* window_title = ' '
DEFAULT_EXTENSION = LV_FORMAT
DEFAULT_FILE_NAME = LV_FILENAME
INITIAL_DIRECTORY = LV_PATH
CHANGING
FILENAME = LV_FILENAME
PATH = LV_PATH
FULLPATH = LV_PATH
USER_ACTION = LV_RESULT.
CHECK LV_RESULT EQ '0'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = LV_FILENAME
FILETYPE = 'ASC'
* APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
* CONFIRM_OVERWRITE = 'X'
TABLES
DATA_TAB = LTY_DATATAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2OTHERS = 3.
This is the code I use to download,it pop ups a dialog and requires the user to save.How can I run it as a background job?
So the file should download and save without the pop up!
2018 Oct 26 2:48 PM
For security reasons it can't be done. You could use a network share or FTP.
2018 Oct 26 2:48 PM
For security reasons it can't be done. You could use a network share or FTP.
2018 Oct 26 3:16 PM
can you give me an example,also keep in mind that the format is not always text,it can be xls...thanks
2018 Oct 26 3:58 PM
To download the file in FTP server, you can refer these demo programs - RSFTP0*. You would get lot of examples in the google to download in the application server.
2018 Oct 27 11:58 AM
Plenty of examples of both if you'll search. Like asked just 9 hours ago. https://answers.sap.com/questions/671763/move-zip-files-from-application-server-to-presenta.html The format of the file is irrelevant.