2008 Nov 10 4:07 PM
Hello.
I need to save my internal table data to an excel file. Is there any useful function module to do this???
Thanks.
2008 Nov 10 4:10 PM
Hi,
create the output in ALV-Grid, change layout to excel and save the excel-sheet.
Regards, Dieter
2008 Nov 10 4:29 PM
2008 Nov 10 6:39 PM
You shouldn't use WS_EXCEL.
I use: REUSE_ALV_GRID_DISPLAY
It is very easy to build an excel output with this FM.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = MYREPORT
is_layout = gd_layout
it_fieldcat = gd_fieldcat[]
i_save = 'X'
TABLES
t_outtab = ITAB
EXCEPTIONS
program_error = 1
others = 2.
Good luck.
SL
2008 Nov 10 4:14 PM
Use the function GUI_DOWNLOAD
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = w_path
filetype = 'DAT'
TABLES
data_tab = it_tab_exp
EXCEPTIONS
file_open_error = 01
file_write_error = 02
invalid_filesize = 03
invalid_table_width = 04
invalid_type = 05
unknow_error = 07.
2024 Mar 15 9:36 AM
what is gd_layout?
Does it gives straightforward excel output?
2024 Mar 15 9:35 AM
there is manual process, but could you provide a code to do it.
2008 Nov 10 4:33 PM
2008 Nov 10 7:57 PM
Use the Function Module - "ALSM_EXCEL_TO_INTERNAL_TABLE".
Regards
Ganesh Reddy.
2008 Nov 10 8:24 PM
The requirements was for Internal Table -> Excel.
Not Excel -> Internal Table.