09-05-2008 3:49 PM
HI all,
I want to download the data into excel with specified path. So what is the standard function module to open the file window.
Thanks
09-05-2008 3:51 PM
You can use:
CALL FUNCTION 'TB_LIMIT_WS_FILENAME_GET'
EXPORTING
def_filename = '*.xls'
mask = '*.xls'
mode = 'S'
IMPORTING
filename = v_path
EXCEPTIONS
selection_cancel = 1
selection_error = 2
OTHERS = 3.
IF sy-subrc EQ 0.
p_p_opfile = v_path.
ENDIF.
09-05-2008 4:01 PM
HI aparna,
In this fm where i need to pass my internle table. Because iam having data in the itab. From this table i need to download.
09-05-2008 4:06 PM
That FM will only open the file dialog.....to get the file name and directory where you want to save the data.
After getting the entire path you have to use GUI_DOWNLOAD:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_path
filetype = 'DAT'
write_field_separator = 'X'
TABLES
data_tab = i_excel "your data itab
fieldnames = i_fname "column headers
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc NE 0.
MESSAGE e000(zfi) WITH text-106.
ENDIF.
09-10-2008 12:05 PM
09-05-2008 3:53 PM
Hi Sultabi,
Use method CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG to open a file window pop up.
Thanks,
Vinay