*&---------------------------------------------------------------------*
*&  Include           ZSOFTCOPY__CL_GUI                                *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*& This file is part of ZSOFTCOPY.                                     *
*&                                                                     *
*& ZSOFTCOPY is free software: you can redistribute it and/or modify   *
*& it under the terms of the GNU General Public License as published   *
*& by the Free Software Foundation, either version 3 of the License,   *
*& or any later version.                                               *
*&                                                                     *
*& ZSOFTCOPY is distributed in the hope that it will be useful,        *
*& but WITHOUT ANY WARRANTY; without even the implied warranty of      *
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
*& GNU General Public License for more details.                        *
*&                                                                     *
*& You should have received a copy of the GNU General Public License   *
*& along with ZDOWNLOAD. If not, see <http://www.gnu.org/licenses/>.   *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&  Author:     Ruediger von Creytz     ruediger.creytz@globalbit.net  *
*&  Copyright:  globalBIT, LLC          http://www.globalbit.net       *
*&                                                                     *
*&---------------------------------------------------------------------*


*-----------------------------------------------------------------------
* cl_gui_get_folder
*-----------------------------------------------------------------------
FORM cl_gui_get_folder
  CHANGING
    c_selected_folder TYPE string
    c_subrc TYPE sysubrc.

  DATA:
  l_obj_file TYPE REF TO cl_gui_frontend_services,
  l_initial_folder TYPE string.

  CREATE OBJECT l_obj_file.

  IF NOT p_folder IS INITIAL.
    l_initial_folder = p_folder.
  ELSE.
    CALL METHOD l_obj_file->get_temp_directory
      CHANGING
        temp_dir = l_initial_folder
      EXCEPTIONS
        OTHERS   = 1.
  ENDIF.

  CALL METHOD l_obj_file->directory_browse
    EXPORTING
      initial_folder  = l_initial_folder
    CHANGING
      selected_folder = c_selected_folder
    EXCEPTIONS
      OTHERS          = 1.
  c_subrc = sy-subrc.
ENDFORM.                    "cl_gui_get_folder
