When using WS_DOWNLOAD, if the directory exists on the PC then the download is successful. However, if the directory does not exist then the download fails. Therefore, you can use GUI_CREATE_DIRECTORY to create the directory at the begining of your ABAP programs. If the directory or folder already exists on the personal computer, the command will just be ignored.
Tested in 4.6x
REPORT ZGUI_DIR.
call function 'GUI_CREATE_DIRECTORY'
exporting
dirname = 'C:\TEST'
EXCEPTIONS
FAILED
= 1
OTHERS
= 2.
if sy-subrc <> 0.
WRITE: / 'Error Code ',SY-SUBRC.
endif.
Return to :-
SAP ABAP/4 Programming, Basis Administration,
Configuration Hints and Tips
(c) www.sap-basis-abap.com All material on this site is
Copyright.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
All product names are trademarks of their respective
companies. The site www.sap-basis-abap.com is in no way affiliated
with SAP AG.
Any unauthorised copying or mirroring is prohibited.