‎2007 Sep 15 2:56 PM
hi all,
i have a prob in creating a f4 help for a parameter to download the error log file to windows using GUI_DOWNLOAD.
Parameter: p_error like rlgrap-filename. i tried fm KD_GET_FILENAME_ON_F4, but it selects the file but i need the folder name to be selected to be downloaded using gui_download.Pls help me in this issue
Thanks in advance,
Prem.
‎2007 Sep 15 3:40 PM
Hi premnath,
try this:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_drctry.
PERFORM get_dir CHANGING p_drctry.
*&---------------------------------------------------------------------*
*& Form get_dir
*&---------------------------------------------------------------------*
FORM get_dir CHANGING p_dir.
DATA:
lv_inidir
TYPE string.
l_dir = lv_inidir
= p_dir.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
window_title = 'Select Directory'
initial_folder = lv_inidir
CHANGING
selected_folder = l_dir
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
* not_supported_by_gui = 3
OTHERS = 4.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'DIR Browse error' sy-subrc p_dir ''.
ENDIF.
p_dir = l_dir.
ENDFORM. " get_dir
Regards,
Clemens
‎2007 Sep 15 3:40 PM
Hi premnath,
try this:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_drctry.
PERFORM get_dir CHANGING p_drctry.
*&---------------------------------------------------------------------*
*& Form get_dir
*&---------------------------------------------------------------------*
FORM get_dir CHANGING p_dir.
DATA:
lv_inidir
TYPE string.
l_dir = lv_inidir
= p_dir.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
window_title = 'Select Directory'
initial_folder = lv_inidir
CHANGING
selected_folder = l_dir
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
* not_supported_by_gui = 3
OTHERS = 4.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'DIR Browse error' sy-subrc p_dir ''.
ENDIF.
p_dir = l_dir.
ENDFORM. " get_dir
Regards,
Clemens