2007 Nov 17 2:13 AM
Hi,
I have a classical report in which I am adding a Button "Export to Excel". Now, if I click that button, I should be able to export my Classical Report to excel. Can somebody please help me on this.
Thanks,
Venkat.
2007 Nov 17 4:12 AM
Hi,
I have a classical report in which I am adding a Button "Export to Excel". Now, if I click that button, I should be able to export my Classical Report to excel. Can somebody please help me on this.
Thanks,
Venkat.
2007 Nov 17 2:19 AM
You can do it with the FM GUI_DOWNLOAD.
Do like this:
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'EXCEL'.
DATA: BEGIN OF it_fieldnames occurs 0, "saving the log file structure
l_f(256) TYPE c,
END OF it_fieldnames.
it_fieldnames = 'Field1'.
Append it_fieldnames.
it_fieldnames = 'Field2'.
append it_fieldnames.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = P_FNAME
filetype = 'DATE'
TABLES
data_tab = IT_DATA " << data tab
fieldnames = it_fieldnames " << for header
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE e999 WITH 'Error File Write Error: ' sy-subrc.
ENDIF.
ENDCASE.
Regards,
Naimesh Patel
2007 Nov 17 4:12 AM
2007 Nov 17 4:20 AM
Hi,
assign a function code to your button & call any one of the following fn modules,
SAP_CONVERT_TO_XLS_FORMAT - it converts data to Microsoft Excel format.
RH_START_EXCEL_WITH_DATA - it starts microsoft excel with the contents of an internal table.
2007 Nov 17 7:02 AM
2007 Nov 17 7:12 AM
HI
use this function module
XXL_FULL_API
with this you can send output of a report to the excel sheet
<b>Reward if usefull</b>
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |