Create a Directory in the user local hardisk

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.

More Function Module
Functions / SAP Script / ALV

Tables
Database Table

ABAP Books List
ABAP/4 Certification, Programming, Smartforms, Sapscripts and Object Oriented Programming Books

Smart Forms
SAP Smartforms

ABAP Menu:
ABAP Example Hints and Tips

Return to Index:-
SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips

(c) www.gotothings.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.gotothings.com is in no way affiliated with SAP AG.
Any unauthorised copying or mirroring is prohibited.