12-03-2007 4:55 PM
Hi abapers!
Greetings from Brazil!
Please I need your wisdom, I am having a big problem to find a function to take the file address(folder) in a browse. But I need to select the folder not the file like happens in WS_FILENAME_GET function for example. Do you guys have any idea??
Thanks for your help.
12-03-2007 5:02 PM
Does'nt it return the absolute file name with the directory. In anycase, you can use CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
Albert
12-03-2007 5:02 PM
Does'nt it return the absolute file name with the directory. In anycase, you can use CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
Albert
12-03-2007 5:02 PM
Hi,
Here is the example code
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK b2.
*Select the file from the Local system
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
DATA: directory TYPE string,
filetable TYPE filetable,
line TYPE LINE OF filetable,
rc TYPE i.
CALL METHOD cl_gui_frontend_services=>get_temp_directory
CHANGING
temp_dir = directory.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'SELECT THE FILE'
initial_directory = directory
file_filter = '*.XLS'
multiselection = ' '
CHANGING
file_table = filetable
rc = rc.
IF rc = 1.
READ TABLE filetable INDEX 1 INTO line.
p_file = line-filename.
ENDIF.
Regards,
Satish