Wednesday, December 22, 2010
REPORT ztest_program.
DATA: window_title TYPE string VALUE 'Set download directory'.
DATA: sapworkdir   TYPE string VALUE 'C:\'.

PARAMETERS folder TYPE string.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR folder.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
window_title         = window_title
initial_folder       = sapworkdir
CHANGING
selected_folder      = folder
EXCEPTIONS
cntl_error           = 1
error_no_gui         = 2
not_supported_by_gui = 3
OTHERS               = 4.
IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF folder IS INITIAL.
MESSAGE 'No folder has been selected' TYPE 'S'.
EXIT.
ENDIF.

START-OF-SELECTION.
WRITE folder.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.