2007 Jul 20 8:03 AM
Hi All ,
I have to add a button on application tool bar .On clicking which user should be prompted to select the file (i.e a File dialog should appear for the user ) .Does any one have idea how to do this ?
Thanks in Advance
-Padma
2007 Jul 20 8:05 AM
Hi Padma,
Use method FILE_OPEN_DIALOG from the CL_GUI_FRONTEND_SERVICES class.
Regards,
Atish
Message was edited by:
Atish Sarda
2007 Jul 20 8:05 AM
Hi Padma,
Use method FILE_OPEN_DIALOG from the CL_GUI_FRONTEND_SERVICES class.
Regards,
Atish
Message was edited by:
Atish Sarda
2007 Jul 20 11:11 AM
hi,
chk out this code
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.', '.xls', '.pdf'
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.
thanks
jaideep
*reward points if useful..