Application Development 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: 

popup for destination folder at selection screen

0 Kudos

hi SAPiens,

i need a function module which will pop-up a window for selecting a folder.........

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Hi,

This sample program found in this forum may this also helpful


report zrich_0001 .
 
parameters: p_path type localfile.
 
 
at selection-screen on value-request for p_path.
 
  data: path_str type string.
 
  call method cl_gui_frontend_services=>directory_browse
      exporting
         window_title    = 'Select Directory'
      changing
         selected_folder = path_str
      exceptions
         cntl_error = 1.
 
  call method cl_gui_cfw=>flush
       exceptions
          cntl_system_error = 1
          cntl_error        = 2.
 
  p_path =  path_str.

aRs

3 REPLIES 3

former_member194669
Active Contributor
0 Kudos

Hi,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME' "For upload of the program

EXPORTING

field_name = 'P_FILE'

IMPORTING

file_name = p_file.

or

can use the methods FILE_OPEN_DIALOG or FILE_SAVE_DIALOG of the class CL_GUI_FRONTEND_SERVICES.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG

EXPORTING

  • WINDOW_TITLE =

  • DEFAULT_EXTENSION =

DEFAULT_FILE_NAME = V_FILENAME

  • WITH_ENCODING =

  • FILE_FILTER =

  • INITIAL_DIRECTORY =

  • PROMPT_ON_OVERWRITE = 'X'

CHANGING

FILENAME = V_FILENAME

PATH = V_FILEPATH

FULLPATH = V_FULLPATH

  • USER_ACTION =

  • FILE_ENCODING =

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.

aRs

0 Kudos

HEY THANKS A LOT BUDDY..............U MADE MY DAY..........

former_member194669
Active Contributor
0 Kudos

Hi,

This sample program found in this forum may this also helpful


report zrich_0001 .
 
parameters: p_path type localfile.
 
 
at selection-screen on value-request for p_path.
 
  data: path_str type string.
 
  call method cl_gui_frontend_services=>directory_browse
      exporting
         window_title    = 'Select Directory'
      changing
         selected_folder = path_str
      exceptions
         cntl_error = 1.
 
  call method cl_gui_cfw=>flush
       exceptions
          cntl_system_error = 1
          cntl_error        = 2.
 
  p_path =  path_str.

aRs