Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

F4 help in selection parameter

Former Member
0 Likes
429

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.

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
410

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

1 REPLY 1
Read only

Clemenss
Active Contributor
0 Likes
411

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