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: 

Question on cl_gui_frontend_services=>file_save_dialog

kowong
Participant
0 Kudos

Hi all,,, need your help.. thank you i n ad vance ..

why ist tht happen? the default extension, 'txt'

but the "save as type" in the dialog box shows 'XLS', excel file ??

CALL METHOD cl_gui_frontend_services=>file_save_dialog

EXPORTING

window_title = 'Save file to'

DEFAULT_EXTENSION = 'txt'

default_file_name = v_filename

INITIAL_DIRECTORY = 'c:\'

CHANGING

filename = t_file

path = ld_path

fullpath = ld_fullpath

user_action = ld_result.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Check out this way ..

CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = 'Select Download File'
default_extension = 'txt'
default_file_name = l_filename1
file_filter = 'All Files (*.*)|*.*|Text files (*.txt)|*.txt'
CHANGING
filename = l_filename2
path = l_path
fullpath = l_fullpath
user_action = l_action
EXCEPTIONS
cntl_error = 1
OTHERS = 2. "#EC NOTEXT
CHECK sy-subrc = 0.
CALL METHOD cl_gui_cfw=>flush.
IF l_action = 0.
p_fname = l_fullpath.
ENDIF.
.

5 REPLIES 5

Former Member
0 Kudos

Check out this way ..

CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = 'Select Download File'
default_extension = 'txt'
default_file_name = l_filename1
file_filter = 'All Files (*.*)|*.*|Text files (*.txt)|*.txt'
CHANGING
filename = l_filename2
path = l_path
fullpath = l_fullpath
user_action = l_action
EXCEPTIONS
cntl_error = 1
OTHERS = 2. "#EC NOTEXT
CHECK sy-subrc = 0.
CALL METHOD cl_gui_cfw=>flush.
IF l_action = 0.
p_fname = l_fullpath.
ENDIF.
.

kowong
Participant
0 Kudos

if i use

file_filter = '*.txt'

the other choices of file type such as ".XLS" is no more there..

what parameter should i put to set the default "save as type" to txt but allow user to select other file type ?

thank you..

0 Kudos

Kokwei Wong ,

you can do in this way....

CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
      window_title      = l_title
      default_extension = 'XLS'
      file_filter       = 'XLS'
    CHANGING
      fullpath          = l_fullpath
      path              = l_path
      filename          = l_filename
    EXCEPTIONS
      OTHERS            = 1.

Regards

Vijay

0 Kudos

you can do in this way....

in this case default is 'XLS' and he can choose all the files.

CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
      window_title      = l_title
      default_extension = 'XLS'
      file_filter       = ' '
    CHANGING
      fullpath          = l_fullpath
      path              = l_path
      filename          = l_filename
    EXCEPTIONS
      OTHERS            = 1.

Regards

Vijay

0 Kudos

ok ... thank you all.....

got it all....