11-17-2006 9:19 AM
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.
11-17-2006 9:24 AM
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.
.
11-17-2006 9:24 AM
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.
.
11-17-2006 9:26 AM
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..
11-17-2006 9:36 AM
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
11-17-2006 9:38 AM
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
11-17-2006 9:51 AM