2007 Oct 17 9:27 AM
Hi gurs,
I have 4 internal tables with me i can able to display in 4 different excel sheets using CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
But my requirement is i want to download 4 internal table in single excel sheets with different tabs. please send the code if u have.
Thanks and regards.
Hi gurs,
I have 4 internal tables with me i can able to display in 4 different excel sheets using CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
But my requirement is i want to download 4 internal table in single excel sheets with different tabs. please send the code if u have.
Thanks and regards.
2007 Oct 17 9:35 AM
Hi,
Provide a button DOWNLOAD on the toolbar/menubar.
Handle the DOWNLOAD button event.
USe GUI_DOWNLOAD for 4 times & pass different internal tables . Ensure that for the last 3 GUI_DOWNLOAD you pass APPEND = 'X'.
CALL FUNCTION 'GUI_DOWNLOAD'
FILE = l_filename
FILE_TYPE = 'ASC'
TABLES
tab = i_tab1.
CALL FUNCTION 'GUI_DOWNLOAD'
FILE = l_filename
FILE_TYPE = 'ASC'
APPEND = 'X' " To append to same file
TABLES
tab = i_tab2.
CALL FUNCTION 'GUI_DOWNLOAD'
FILE = l_filename
FILE_TYPE = 'ASC'
APPEND = 'X' " To append to same file
TABLES
tab = i_tab3.
CALL FUNCTION 'GUI_DOWNLOAD'
FILE = l_filename
FILE_TYPE = 'ASC'
APPEND = 'X' " To append to same file
TABLES
tab = i_tab4.
2007 Oct 17 9:52 AM
2007 Oct 17 9:55 AM
Hi,
If you want to display the content of 4 internal table in different sheets of same workbook then go through below code,
DATA : EXCEL TYPE OLE2_OBJECT,
WORKBOOKS TYPE OLE2_OBJECT,
WORKBOOK TYPE OLE2_OBJECT,
CELLS TYPE OLE2_OBJECT,
SHEET TYPE OLE2_OBJECT,
FONT TYPE OLE2_OBJECT,
H_COM1 TYPE OLE2_OBJECT,
F TYPE RLGRAP-FILENAME,
FILEP TYPE DRAW-FILEP,
G_FILE_DEST TYPE STRING,
G_FILE_TEMP TYPE STRING,
G_SYSUBRC TYPE SY-SUBRC,
G_FILE_SRC TYPE DRAW-FILEP.
START THE EXCEL APPLICATION
CREATE OBJECT excel 'EXCEL.APPLICATION'.
CALL METHOD OF excel 'WORKBOOKS' = workbooks.
SET PROPERTY OF excel 'VISIBLE' = 0.
CALL METHOD OF workbooks 'OPEN' EXPORTING
#1 = filep.
For Sheet1
CALL METHOD OF excel 'Worksheets' = sheet
EXPORTING #1 = 1.
CALL METHOD OF sheet 'Activate'.
FREE OBJECT sheet.
CALL METHOD OF excel 'CELLS' = cells
EXPORTING #1 = 1
#2 = 15.
SET PROPERTY OF cells 'VALUE' = <value>
CALL METHOD OF cells 'FONT' = font.
SET PROPERTY OF font 'SIZE' = '20'.
FREE OBJECT cells.
For Sheet2
CALL METHOD OF excel 'Worksheets' = sheet
EXPORTING #1 = 2.
CALL METHOD OF sheet 'Activate'.
FREE OBJECT sheet.
CALL METHOD OF excel 'CELLS' = cells
EXPORTING #1 = 1
#2 = 6.
SET PROPERTY OF cells 'VALUE' = 'XYZ'.
CALL METHOD OF cells 'FONT' = font.
SET PROPERTY OF font 'SIZE' = '20'.
GET PROPERTY OF excel 'ACTIVESHEET' = sheet.
CALL METHOD OF sheet 'SAVEAS' EXPORTING
#1 = <destination file path where you want to store>
#2 = 1.
CALL METHOD OF workbooks 'CLOSE'.
CALL METHOD OF excel 'QUIT'.
FREE OBJECT excel.
Thanks!
Brunda
'Reward if useful'.
2009 Sep 25 9:48 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |