Application Development 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: 

On Clicking a button File Dialog should be prompted to the user ?

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Padma,

Use method FILE_OPEN_DIALOG from the CL_GUI_FRONTEND_SERVICES class.

Regards,

Atish

Message was edited by:

Atish Sarda

2 REPLIES 2

Former Member
0 Kudos

Hi Padma,

Use method FILE_OPEN_DIALOG from the CL_GUI_FRONTEND_SERVICES class.

Regards,

Atish

Message was edited by:

Atish Sarda

jaideeps
Advisor
Advisor
0 Kudos

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..