2007 Sep 10 7:08 PM
Hi,
I'm using the following code to download a report into excel
DATA: begin of i_ascii_list occurs 0, text(134) type c, end of
i_ascii_list.
DATA lista LIKE abaplist OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'LIST_FREE_MEMORY'
TABLES
listobject = lista.
SUBMIT RHRHDC00
AND RETURN
EXPORTING LIST TO MEMORY.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = lista
EXCEPTIONS
OTHERS = 1.
perform save_ascii_list.
call function 'MS_EXCEL_OLE_STANDARD_DAT'
exporting
file_name = 'C:\sample.XLS'
tables
data_tab = i_ascii_list.
*#####################################-
FUNCTION: save_ascii_list
*#####################################-
form save_ascii_list.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
LIST_INDEX = -1
TABLES listasci = i_ascii_list
listobject = lista
EXCEPTIONS empty_list = 1
list_index_invalid = 2
OTHERS = 3.
endform.
The problem is that excel file shows all the information of each row in first column. I need for each column of the report to be in one column of excel, like when you download the report via menu list-> export -> spreadsheet. How to do that? There is some better way to convert report RHRHDC00 (for example) into excel?
Thanks in advance
You can use the function module ''ALV_XXL_CALL'" to download Data in a Excel file.You can avoid the problem of downloading data into same Column.
If you want to know how it is used. See the SAP Program "XXLFTEST".
Thanks
Shekar
2007 Sep 11 9:55 PM
You can use the function module ''ALV_XXL_CALL'" to download Data in a Excel file.You can avoid the problem of downloading data into same Column.
If you want to know how it is used. See the SAP Program "XXLFTEST".
Thanks
Shekar
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |