2009 Jul 06 11:35 AM
Hi All
I am new to ABAP. I am planning to export data from tables to excel. Is there any helpful function modules or sample report program.
Thanks in advance
2009 Jul 06 11:47 AM
hi
use this simple code .
CONCATENATE filename '.XLS' INTO lv_filename1.
TYPES:BEGIN OF gty_header,
name(30) TYPE c,
END OF gty_header.
gs_header-name = field name.
APPEND gs_header TO gt_header.
CLEAR gs_header.
append all the field names to the gt_header.
and in the function module pass
the gt_header as
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_filename1
write_field_separator = 'X'
TABLES
data_tab = gt_final
fieldnames = gt_header
EXCEPTIONS
file_write_error = 1
unknown_error = 2.
gt_final has the internal table data,
gt_header has field names.
~linganna
hi
use this simple code .
CONCATENATE filename '.XLS' INTO lv_filename1.
TYPES:BEGIN OF gty_header,
name(30) TYPE c,
END OF gty_header.
gs_header-name = field name.
APPEND gs_header TO gt_header.
CLEAR gs_header.
append all the field names to the gt_header.
and in the function module pass
the gt_header as
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_filename1
write_field_separator = 'X'
TABLES
data_tab = gt_final
fieldnames = gt_header
EXCEPTIONS
file_write_error = 1
unknown_error = 2.
gt_final has the internal table data,
gt_header has field names.
~linganna
2009 Jul 06 11:39 AM
2009 Jul 06 11:41 AM
Hi Rakshita,
Go to t-code SE11
give your table name and execute it on selected condition.
AFter that goto
Table entry -> list -> Export -> Local file
select radiobutton spreadsheet
and say ok .
It will store your table data to excel file at your desired location.
Regards,
Vijay
2009 Jul 06 11:45 AM
But in this case you need to select all the objects manually no...I need to fetch them all at once the function module will be helpful..can you give me a sample code also.. I am completly new to ABAP...
thanks
2009 Jul 06 11:44 AM
Hi,
Do you want to download from the internal table to excel? If yes, then GUI_DOWNLOAD should work provided suffix the extension of the file name as ".xls".
Hope this helps.
Regards,
Anand Patil
2009 Jul 06 11:47 AM
hi
use this simple code .
CONCATENATE filename '.XLS' INTO lv_filename1.
TYPES:BEGIN OF gty_header,
name(30) TYPE c,
END OF gty_header.
gs_header-name = field name.
APPEND gs_header TO gt_header.
CLEAR gs_header.
append all the field names to the gt_header.
and in the function module pass
the gt_header as
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_filename1
write_field_separator = 'X'
TABLES
data_tab = gt_final
fieldnames = gt_header
EXCEPTIONS
file_write_error = 1
unknown_error = 2.
gt_final has the internal table data,
gt_header has field names.
~linganna
2009 Jul 06 11:51 AM
I am sorry to mention late here I am trying to flush from DDIC table and not internal table.
Thanks for help
Edited by: rakshita hegde on Jul 6, 2009 1:15 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |