05-15-2007 1:35 PM
Hi,
My requirement is to download 3 different data to three different sheets of the Excel.I have followed this weblog "/people/sudheer.junnuthula2/blog/2006/12/27/creating-excel-with-more-than-one-page " the problem is am getting the first sheet in the place of Sheet no.1 but the second and third sheets are just adding to the Excel ..that is
altogether am getting % sheets ,"Third ,Second,First,Sheet2,Sheet3 ".
What has to be done so that the second and third sheets come in the place of sheet2 and Sheet3.
Thanks in advance.
Bhanu.
07-31-2007 5:41 AM
Hello Bhanu,
The method i use is to create all the sheets first and then activate and use them as required
* creating sheets
DO 3 TIMES.
IF sy-index GT 1.
CALL METHOD OF excel 'WORKSHEETS' = sheet.
CALL METHOD OF sheet 'ADD'.
FREE OBJECT sheet.
ENDIF.
ENDDO.
data: lv_count type i.
* using them
count = 1.
DO 3 TIMES.
CALL METHOD OF excel 'WORKSHEETS' = sheet
EXPORTING
#1 = count.
CASE count.
WHEN '1'.
"code
WHEN '2'.
"code
WHEN '3'.
"code
ENDCASE.
count = count + 1.
ENDDO.
05-16-2007 6:38 AM
hi..
if u have output in ALV... u following steps r supposed to be followed...
-> click button 'change layout' (at output screen..)
-> deselect fields u dont want to be there in excel...
-> now it'll display selectd columns only...
-.> export list by ctrlshftf7...
->follow same for rest of the sheets....
if u have output thru script or smartform...then u cant split output in different excel sheet...it'll merge whole data in one sheet only...
revert back if it is not sufficient..
07-31-2007 5:41 AM
Hello Bhanu,
The method i use is to create all the sheets first and then activate and use them as required
* creating sheets
DO 3 TIMES.
IF sy-index GT 1.
CALL METHOD OF excel 'WORKSHEETS' = sheet.
CALL METHOD OF sheet 'ADD'.
FREE OBJECT sheet.
ENDIF.
ENDDO.
data: lv_count type i.
* using them
count = 1.
DO 3 TIMES.
CALL METHOD OF excel 'WORKSHEETS' = sheet
EXPORTING
#1 = count.
CASE count.
WHEN '1'.
"code
WHEN '2'.
"code
WHEN '3'.
"code
ENDCASE.
count = count + 1.
ENDDO.