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

explore file on screen

Former Member
0 Likes
362

hi guys

i have to make a screen where user can put file path through explore. actually file will be on presentation server.

please help

regards

gani

2 REPLIES 2
Read only

Former Member
0 Likes
343

Hi,

you can use the class cl_gui_frontend_services to do this. Use method file_save_dialog or method file_open_dialog.

Regards

Thomas

Read only

Pawan_Kesari
Active Contributor
0 Likes
343

try this code



REPORT zreport.

PARAMETERS : p_path TYPE text100 OBLIGATORY .

*&---------------------------------------------------------------------*
*& AT SELECTION-SCREEN
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path .  
    PERFORM get_file_help .

*&---------------------------------------------------------------------*
*& Form get_file_help
*&---------------------------------------------------------------------*
FORM get_file_help.
  DATA : i_file TYPE filetable ,
         w_file TYPE file_table ,
         l_rc TYPE i ,
         l_ua TYPE i .

  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    CHANGING
      file_table              = i_file
      rc                      = l_rc
      user_action             = l_ua
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      OTHERS                  = 4.

  IF l_ua <> cl_gui_frontend_services=>action_cancel .
    READ TABLE i_file INTO w_file INDEX 1 .
    IF sy-subrc = 0 .
      p_path = w_file-filename .
    ENDIF.
  ENDIF.

ENDFORM. " get_file_help