on 02-13-2006 10:43 AM
Hi all,
I want to provide search help for file-name field in the selection screen to specify the path of the file to download the data at the local computer.
Pls. help with some ideas.
Thanx.
hi,
use mthd FILE_OPEN_DIALOG of class
CL_GUI_FRONTEND_SERVICES
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all ,
Thanks for the ideas.
A lot of knowledge for a fresher like me.
Thanx a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use the following codes:
1) Using Function Module:
PARAMETERS: p_ppath TYPE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ppath.
Open the Browse Dialog Box on the Desktop
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
CHANGING
file_name = p_ppath
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
2) Using method:
DATA: git_tab TYPE filetable,
gv_subrc TYPE i.
Constants: gc_wondowtitle TYPE string VALUE 'Select',
gc_defaultfile TYPE string VALUE '*.csv',
gc_defaultdir TYPE string VALUE 'C:\'.
Open the Browse Dialog Box on the Desktop
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = gc_wondowtitle
default_filename = gc_defaultfile
initial_directory = gc_defaultdir
CHANGING
file_table = git_tab
rc = gv_subrc.
Assign the selected file name to the file path field
READ TABLE git_tab INTO p_ppath INDEX 1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
*&---------------------------------------------------------------------*
*& Form f1003_f4_hlp_for_pc_file
*&---------------------------------------------------------------------*
* F4 Hlep for PC File
*----------------------------------------------------------------------*
FORM f1003_f4_hlp_for_pc_file.
DATA: li_filetable TYPE STANDARD TABLE OF file_table,
lv_return TYPE i,
lw_filetable TYPE file_table.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select file for download'
default_extension = '.txt'
* DEFAULT_FILENAME = '.txt'
* file_filter = '*.txt ,*.txt.'
initial_directory = 'C:'
CHANGING
file_table = li_filetable
rc = lv_return
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
OTHERS = 4
.
IF sy-subrc <> 0.
MESSAGE e003 WITH text-015.
ELSE.
READ TABLE li_filetable INTO lw_filetable INDEX 1.
p_fnam2 = lw_filetable-filename.
ENDIF.
Best Regards,
Anjali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR TAB_FILE-LOW.
PERFORM F4_HELP CHANGING TAB_FILE-LOW.
FORM F4_HELP CHANGING TAB_FILE-LOW.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = tab_file-low.
END FORM.
Hope it'll be useful.
Regards,
Mireia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi stock,
try the FM TMP_GUI_FILE_OPEN_DIALOG.. you can specify your default file and directory also
A sample..
PARAMETERS : DATASET(128).
AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATASET.
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
* EXPORTING
* WINDOW_TITLE =
* DEFAULT_EXTENSION =
* DEFAULT_FILENAME =
* FILE_FILTER =
* INIT_DIRECTORY =
* MULTISELECTION =
* IMPORTING
* RC =
TABLES
FILE_TABLE = itab
* EXCEPTIONS
* CNTL_ERROR = 1
* OTHERS = 2
regards
satesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stock,
This works well.. I've tried it..
Made small changes to the previous one..
PARAMETERS : DATASET(128).
data : itab like table of FILE_TABLE with header line.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATASET.
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILENAME =
FILE_FILTER =
INIT_DIRECTORY =
MULTISELECTION =
IMPORTING
RC =
TABLES
FILE_TABLE = itab
EXCEPTIONS
CNTL_ERROR = 1
OTHERS
.
loop at itab.
DATASET = itaB-FILENAME.
endloop.
ps: reward points if helpful.
regards
satesh
Hi stock,
1. use the fm
F4_FILENAME
2. use like this
PARAMETERS : p_file LIKE rlgrap-filename
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
regards,
amit m.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.