‎2007 Dec 14 10:09 AM
Hello All,
How we can select one directory name in to the selection screen. Which Function Module can I use for that?
Thanks in Advance
regards,
LIJO
‎2007 Dec 14 10:11 AM
‎2007 Dec 14 10:20 AM
Hi,
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = p_file
dyname = sy-cprog
dynumb = sy-dynnr
filetype = c_p
location = c_a
server = space.
Message was edited by:
Jayanthi Jayaraman
‎2007 Dec 14 10:27 AM
use module FM RZL_READ_DIR_LOCAL
pass the dir eg 'C:'
it will return iternal table with all the contents
or try another method
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
REFRESH: it_tab[].
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select File'
default_filename = '*.pdf'
file_filter = '*.pdf'
CHANGING
file_table = it_tab
rc = gd_subrc.
READ TABLE it_tab INTO wa_tab INDEX 1.
IF NOT wa_tab IS INITIAL.
file = wa_tab-filename.
ELSE.
MESSAGE s000(0k) WITH 'Please enter valid file name'(001).
STOP.
ENDIF.
START-OF-SELECTION.
SET SCREEN 100.
reward if useful
Message was edited by:
Sumesh Nair
‎2007 Dec 14 10:54 AM
Hi Lijo ,
You can use the following function module
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = syst-repid
dynpro_number = syst-dynnr
MASK = WA_MASK
CHANGING
file_name = fname
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.