Excel multiple tab sheets
how to download data into multiple tab sheets in a single file
report zole123.
INCLUDE ole2incl.
DATA: count TYPE i,
application TYPE ole2_object,
workbook TYPE ole2_object,
excel TYPE ole2_object,
sheet TYPE ole2_object,
cells TYPE ole2_object.
CONSTANTS: row_max TYPE i VALUE 256.
DATA index TYPE i.
DATA: BEGIN OF itab1 OCCURS 0, first_name(10), END OF itab1.
DATA: BEGIN OF itab2 OCCURS 0, last_name(10), END OF itab2.
DATA: BEGIN OF itab3 OCCURS 0, place(50), END OF itab3.
*START-OF-SELECTION
START-OF-SELECTION.
APPEND: 'roshani' TO itab1, 'jain' TO itab2,
'worli' TO itab3,
'nehal' TO itab1, 'shah' TO itab2,
'chowpatty' TO itab3,
'saad' TO itab1, 'sheikh' TO itab2,
'versova' TO itab3,
'sushilnath' TO itab1, 'shukla' TO itab2,
'grant road' TO itab3,
'ajju' TO itab1, 'ratna' TO itab2,
'gaon' TO itab3,
'sanant' TO itab1, 'R.' TO itab2,
'mahim' TO itab3.
* CREATE OBJECT application 'excel.application'.
* SET PROPERTY OF application 'visible' = 1.
* CALL METHOD OF application 'Workbooks' = workbook.
* CALL METHOD OF workbook 'Add'.
CREATE OBJECT excel 'EXCEL.APPLICATION'.
IF sy-subrc NE 0.
WRITE: / 'No EXCEL creation possible'.
STOP.
ENDIF.
SET PROPERTY OF excel 'DisplayAlerts' = 0.
CALL METHOD OF excel 'WORKBOOKS' = workbook .
SET PROPERTY OF excel 'VISIBLE' = 1.
* Create worksheet
SET PROPERTY OF excel 'SheetsInNewWorkbook' = 1.
CALL METHOD OF workbook 'ADD'.
DO 3 TIMES.
IF sy-index GT 1.
CALL METHOD OF excel 'WORKSHEETS' = sheet.
CALL METHOD OF sheet 'ADD'.
FREE OBJECT sheet.
ENDIF.
ENDDO.
count = 1.
DO 3 TIMES.
CALL METHOD OF excel 'WORKSHEETS' = sheet
EXPORTING
#1 = count.
* perform get_sheet_name using scnt sname.
CASE count.
WHEN '1'.
SET PROPERTY OF sheet 'NAME' = 'firstName'.
CALL METHOD OF sheet 'ACTIVATE'.
itab1-first_name = 'FIRST NAME'.
LOOP AT itab1.
index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
SET PROPERTY OF cells 'Formula' = itab1-first_name.
SET PROPERTY OF cells 'Value' = itab1-first_name.
ENDLOOP.
WHEN '2'.
SET PROPERTY OF sheet 'NAME' = 'LastName'.
CALL METHOD OF sheet 'ACTIVATE'.
LOOP AT itab2.
index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
SET PROPERTY OF cells 'Formula' = itab2-last_name.
SET PROPERTY OF cells 'Value' = itab2-last_name.
ENDLOOP.
WHEN '3'.
SET PROPERTY OF sheet 'NAME' = 'place'.
CALL METHOD OF sheet 'ACTIVATE'.
LOOP AT itab3.
index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
SET PROPERTY OF cells 'Formula' = itab3-place.
SET PROPERTY OF cells 'Value' = itab3-place.
ENDLOOP.
ENDCASE.
count = count + 1.
ENDDO.
* Save excel speadsheet to particular filename
GET PROPERTY OF excel 'ActiveSheet' = sheet.
CALL METHOD OF sheet 'SaveAs'
EXPORTING #1 = 'c:tempexceldoc1.xls' "filename
#2 = 1. "fileFormat
Similar Messages
-
Export report in xlsx with multiple tabs/sheets
Hi,
Using CR2011, can I export reports in excel which will have multiple sheets? I checked the forum but none seems answered.
Anyone want to help?
Thank you.Hi Vijay,
If you're exporting to .xlsx, then unfortunately Crystal Reports won't create multiple sheets.
The newer version of Excel supports more than 65536 rows on one sheet.
Export to the older version of Excel if you wish to see multiple sheets.
-Abhilash -
Excel sheet with multiple tabs to be sent as email
Hi Experts,
I have a requirement to generate an Excel sheet with multiple tabs to be sent as email to a distribution list.
Please help if you have any ideas on the same.
Thanks,
Preema[http://wiki.sdn.sap.com/wiki/display/ABAP/ToGetFieldDetailsSavedinVariantLayout|http://wiki.sdn.sap.com/wiki/display/ABAP/ToGetFieldDetailsSavedinVariantLayout]
with this we can get the modified field catalog based on layout variant
without calling alv output function modules
Thanks! SDN. -
How can i create excel sheet with multiple tabs using utl file?
how can i create excel sheet with multiple tabs using utl file?
any one help me?Jaggy,
I gave you the most suitable answer on your own thread yesterday
Re: How to Generating Excel workbook with multiple worksheets -
Background processing- download multiple itabs into one excel with tabs
Hello,
I want to run a report as a background job and download the outputs in excel file into different tabs.
Problem is OLE does not run in background mode.
Are there any other alternatives for that?
I searched the forum and did not get any useful answer for background procesing. All the topics use for foreground processing.
(Old query for reference:- )
[background processing] multiple work sheets in single attachment file
Thanks.Hi,
Even i had the same issue before, what i did is, i written a program which will run in the background and stores the data in application server file, and also it sends the email to user saying that 'the data is soted in application server, to veiw please run the ZXXXX transaction code to view,
The second transaction code is having the OLE code which will download the data into an excel sheets with more than 1 tab.
Thanks
Sudheer -
Download data from multiple tabs of ALV to tabs of Excel
Hi,
I have a requirement where ALV is being displayed in 6 tabs. Can a download functionality be provided in such a way that data from all the tabs gets downloaded into multiple sheets of Excel document.
In the attached file, expected output with ALV in multiple tabs is displayed. Are there any Function modules which can be used to download data from ALV in each tab into Excel document sheets in one go?
Thanks,
Tejaswini.This is a FAQ, did you use search tool with keywords like worksheet, activate and OLE to find many threads and (some examples)
a sample like XLSX Upload - A Unified Approach
a project like abap2xlsx
Regards,
Raymond -
Export to Excel functionality for Multiple tabs in WAD
Hi,
I have a requirement where in i need to export a report from WAD to excel. The WAD template has multiple tabs which i want individually in seperate excel sheet tabs. How can i achieve this ?
Regards
Snehith.Hi,
have a global button (some where on the top) with command 'export to excel' and configure all your analysis item for that button. So when u execute the template and when u click on individual tab, the report out from individual tab will be exported to excel when u click on Export to excel button.In this way u can individually export the output to excel.
Regards -
Downloading data into multiple work sheets in excel
Hi All,
Could you please tell me the way of downloading data into multiple work sheets .
Now, we are downloading data into multiple excel files and after that copying all the excel file data in to different work sheets of the single excel manually.
So , here I want directly download the data into different work sheets of single excel file.
Regards,
Siddivinesh JoguHi,
Down load into three worksheets in one XL
REPORT ZKC_TEST1.
INCLUDE ole2incl.
DATA: w_cell1 TYPE ole2_object,
w_cell2 TYPE ole2_object.
*--- Ole data Declarations
DATA: h_excel TYPE ole2_object, " Excel object
h_mapl TYPE ole2_object, " list of workbooks
h_map TYPE ole2_object, " workbook
h_zl TYPE ole2_object, " cell
h_f TYPE ole2_object, " font
gs_interior TYPE ole2_object, " Pattern
worksheet TYPE ole2_object,
h_cell TYPE ole2_object,
h_cell1 TYPE ole2_object,
range TYPE ole2_object,
h_sheet2 TYPE ole2_object,
h_sheet3 TYPE ole2_object,
gs_font TYPE ole2_object,
e_color TYPE ole2_object,
gs_italic TYPE ole2_object,
flg_stop(1) TYPE c.
** Internal table Declaration
DATA: BEGIN OF t_excel OCCURS 0,
MATNR type mara-matnr, "(18) type c,
ERSDA type mara-ersda, " (8) type c,
ERNAM type mara-ernam, "(12) type c,
LAEDA type mara-laeda, "(8) type c,
AENAM type mara-aenam, "(12) type c,
VPSTA type mara-vpsta, "(15) type c,
PSTAT type mara-pstat, "(15) type c,
END OF t_excel.
DATA: t_excel_bckord LIKE t_excel OCCURS 0 WITH HEADER LINE,
t_excel_bcklog LIKE t_excel OCCURS 0 WITH HEADER LINE,
t_excel_blkord LIKE t_excel OCCURS 0 WITH HEADER LINE.
data: wa_excel_bckord like line of t_excel.
TYPES: data1(1500) TYPE c,
ty TYPE TABLE OF data1.
DATA: it TYPE ty WITH HEADER LINE,
it_2 TYPE ty WITH HEADER LINE,
it_3 TYPE ty WITH HEADER LINE,
rec TYPE sy-tfill,
deli(1) TYPE c,
l_amt(18) TYPE c.
DATA: BEGIN OF hex,
tab TYPE x,
END OF hex.
FIELD-SYMBOLS: <fs> .
CONSTANTS cns_09(2) TYPE n VALUE 09.
ASSIGN deli TO <fs> TYPE 'X'.
hex-tab = cns_09.
<fs> = hex-tab.
DATA gv_sheet_name(20) TYPE c .
*---selecting into tables
select MATNR
ERSDA
ERNAM
LAEDA
AENAM
VPSTA
PSTAT
from mara into table t_excel_bckord
where pstat = 'KVELBCD'.
wa_excel_bckord-matnr = 'MATNR'.
wa_excel_bckord-ersda = 'ERSDA'.
wa_excel_bckord-ernam = 'ERNAM'.
wa_excel_bckord-laeda = 'LAEDA'.
wa_excel_bckord-aenam = 'AENAM'.
wa_excel_bckord-vpsta = 'VPSTA'.
wa_excel_bckord-pstat = 'PSTAT'.
INSERT wa_excel_bckord
INTO t_excel_bckord INDEX 1 .
select MATNR
ERSDA
ERNAM
LAEDA
AENAM
VPSTA
PSTAT
from mara into table t_excel_bcklog
where pstat = 'KVELBCDP'.
INSERT wa_excel_bckord
INTO t_excel_bcklog INDEX 1 .
select MATNR
ERSDA
ERNAM
LAEDA
AENAM
VPSTA
PSTAT
from mara into table t_excel_blkord
where pstat = 'KEBC'.
INSERT wa_excel_bckord
INTO t_excel_blkord INDEX 1 .
LOOP AT t_excel_bckord.
CONCATENATE
t_excel_bckord-MATNR
t_excel_bckord-ERSDA
t_excel_bckord-ERNAM
t_excel_bckord-laeda
t_excel_bckord-aenam
t_excel_bckord-vpsta
t_excel_bckord-pstat
INTO it
SEPARATED BY deli.
APPEND it.
CLEAR it.
ENDLOOP.
LOOP AT t_excel_bcklog.
CONCATENATE
t_excel_bcklog-matnr
t_excel_bcklog-ersda
t_excel_bcklog-ernam
t_excel_bcklog-laeda
t_excel_bcklog-aenam
t_excel_bcklog-vpsta
t_excel_bcklog-pstat
INTO it_2
SEPARATED BY deli.
APPEND it_2.
CLEAR it_2.
ENDLOOP.
LOOP AT t_excel_blkord.
CONCATENATE
t_excel_blkord-matnr
t_excel_blkord-ersda
t_excel_blkord-ernam
t_excel_blkord-laeda
t_excel_blkord-aenam
t_excel_blkord-vpsta
t_excel_blkord-pstat
INTO it_3
SEPARATED BY deli.
APPEND it_3.
CLEAR it_3.
ENDLOOP.
*--- start Excel
IF h_excel-header = space OR h_excel-handle = -1.
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
ENDIF.
*--- get list of workbooks, initially empty
CALL METHOD OF h_excel 'Workbooks' = h_mapl.
SET PROPERTY OF h_excel 'Visible' = 1.
CALL METHOD OF h_mapl 'Add' = h_map.
gv_sheet_name = 'Back Orders'.
GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
*--Formatting the area of additional data 1 and doing the BOLD
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = 50.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
SET PROPERTY OF gs_font 'Name' = 'Arial' .
GET PROPERTY OF h_cell 'Interior' = e_color.
SET PROPERTY OF e_color 'ColorIndex' = 35.
GET PROPERTY OF h_cell 'Font' = gs_italic .
SET PROPERTY OF gs_italic 'Italic' = 1 .
DATA l_rc TYPE i.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = it[]
CHANGING
rc = l_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Range' = range
EXPORTING
#1 = w_cell1
#2 = w_cell2.
CALL METHOD OF range 'Select'.
CALL METHOD OF worksheet 'Paste'.
gv_sheet_name = 'Backlog'.
GET PROPERTY OF h_excel 'Sheets' = h_sheet2 .
CALL METHOD OF h_sheet2 'Add' = h_map.
SET PROPERTY OF h_map 'Name' = gv_sheet_name .
GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
*--Formatting the area of additional data 1 and doing the BOLD
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = 50.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
GET PROPERTY OF h_cell 'Interior' = e_color.
SET PROPERTY OF e_color 'ColorIndex' = 40.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = it_2[]
CHANGING
rc = l_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Range' = range
EXPORTING
#1 = w_cell1
#2 = w_cell2.
CALL METHOD OF range 'Select'.
CALL METHOD OF worksheet 'Paste'.
gv_sheet_name = 'Blocked Orders'.
GET PROPERTY OF h_excel 'Sheets' = h_sheet3 .
CALL METHOD OF h_sheet3 'Add' = h_map.
SET PROPERTY OF h_map 'Name' = gv_sheet_name .
GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
*--Formatting the area of additional data 1 and doing the BOLD
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = 50.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
GET PROPERTY OF h_cell 'Interior' = e_color.
SET PROPERTY OF e_color 'ColorIndex' = 45.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = it_3[]
CHANGING
rc = l_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Range' = range
EXPORTING
#1 = w_cell1
#2 = w_cell2.
CALL METHOD OF range 'Select'.
CALL METHOD OF worksheet 'Paste'.
*--- disconnect from Excel
FREE OBJECT h_zl.
FREE OBJECT h_mapl.
FREE OBJECT h_map.
FREE OBJECT h_excel.
Thanks,
Krishna.. -
Exporting data into multiple tabs of Excel from OA Framework Page.
Hii,
I have a requirement like exporting data into multiple tabs of Excel from OA Framework.
Like One Quarter Data should be in one Excel Sheet, and the Second Quarter data should go into other Excel Sheet, like wise ...
I have tried searching forums, and developers guide, But couldn't find any correct answer on this. If its there on developers guide can somebody point me exactly where it is located.
If someone can help me through this or can guide me through any document in this. It would be really helpful.
Thanks
Prakash.I guess, tabs are not supported in XML publisher as well.
I would be worth checking at with BI publisher forum.
--Prasanna -
Hi All,
I am totally new to SAP-BODS can you please help me in importing a EXCEL file having multiple tabs, Which are having same structure.
Thanks in Advance,
DJIf you are asking about delete script after the data flow in the document.
Load Script:
$G_LIST_SHEET = sql( 'SQL_DB','select top 1 SHEET_NAMES from SHEET_LIST');
Here $G_LIST_SHEET is the global variable where i assigned this global var to Excel Workbook Sheet Name.
Where first workflow target table name is SHEET_LIST and column name is SHEET_NAMES.
am writing a sql command to select top row from the column SHEET_NAMES from table SHEET_LIST.
Where
SQL_DB is my Datastore name
SHEET_LIST is my table name
SHEET_NAME is the column name in the SHEET_LIST.
Delete Script:
sql('SQL_DB','delete SHEET_LIST where SHEET_NAMES = {$G_LIST_SHEET }');
This script will delete the first row from the SHEET_LIST table.
Because when you want to load again the data again it will select the 2nd sheet names as the first.
Am sharing .ATL file please go through once if you have any queries please let me know.
Microsoft OneDrive - Multisheet.ATL
Passphrase: Akhil
Regards,
Akhileshkiran. -
Recently I got a new laptop, with excel 2010 version and acrobat 9 standard.
I could no longer print (save as) an excel file with multiple tabs into a pdf file with bookmarks.
My old computer has excel 2007 version and acrobat 9 standard.
Print an excel file into pdf with bookmarks was a piece of cake.
Both machine has the same add-in -- Acrobat PDFMaker Office COM addin
Thanks if anyone could help me with this.
TomYou need to upgrade Acrobat to a newer version.
On Thu, Oct 30, 2014 at 4:12 PM, excel-pdf-bookmarks < -
How do I print multiple tabs in excel to one pdf
I am using Excel for Mac 2011 and want to select multiple tabs and have this print to one pdf file. I can print to a normal printer, and have done this for years on a PC, but the Mac pdf function seperates it into seperate files. I am happy to buy an aftermarket soeftware program for a reasonable price.
i would not have posted this without extensive experience, please don't feel slighted. There are a number of posts about this on other blogs and i am hoping this network might help me solve it.
I did make one error in my description, as it is true that sigle page documents under seperate tabs will sometimes combine into a single pdf...but not always in my experience.
I am absolutely certain that multiple page documents under seperate tabs will not combine. I will also crarify that while all tabs are portrait, they do not have the same fomatting and # of columns.
Finally, this absolutely does work in Excel 2010 for PC when writing to a pdf writer, the problem seems to be Mac based. My sense is I need to buy a 3rd party pdf writer that truly acts like a printer with its own drivers, does anyone make this? -
How to subscribe the report into one excel multiple sheets in ssrs
Hi Team,
I have a requirement where i pull my report in one excel with multiple sheets,
1.I have a Emp_Report where i could subscribe my report into excel format,but here i want to subscribe this into multiple sheets in one excel form.
2.Is it possible to subscribe the two reports in one excel with mulitiple sheets.i need this also.
please guide me hw we can achive me ,so that i can start working on that .
am using sql server 2008R2 sql server edition.
pls help me out for thisHi Ychinnari,
According to your description, you want to perform subscription for one report or two reports into multiple sheets within a Excel file.
In Reporting Services, when we add a page break within the report, those pages will be exported into separated sheets in Excel.
For first requirement, subscribe one report into multiple sheets in one Excel file. We can add a page break within a group, then the report will display on multiple sheets when subscribe into Excel format.
For second requirement, subscribe one report into multiple sheets in one Excel file. You can add one report as a subreport into the main report, then add pagebreak between main report and subreport.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
How to read an excel file which contains multiple tabs using File adapter
Hi BPEL gurus,
I have a requirement where i need to read an EXCEL file, which has three tabs inside the file. All the three tabs has data in it. I have seen few examples where file adapter reads an excel file with data present inside a single tab but not with multiple tabs.
If anyone has worked on this scenario, please provide your suggestions/inputs/links etc.
Thanks in advancehi Sathish,
this might help
PI/XI: Reading MS Excel's XLSX and XLSM files with standard PI modules - easily...
thanks and regards,
Praveen T -
Hi,
I have a requirement where i need to put data in various tabs in excel, is it possible to genrate excel report with multiple tabs through oracle report builder, if yes then please guide me how to go about it.
Thanks...
AshishHello,
you can use XML-format to generate reports with more than one worksheet using PL/SQL only and there are free packages to do so:
https://xml-spreadsheet.samplecode.oracle.com/
or
https://exceldocumenttype.samplecode.oracle.com/
Regards
Marcus
Maybe you are looking for
-
More Problems with iTunes 7,0
I, like many other people it seems, have been having problems with my iTunes ever since I downloaded the latest upgrade for it. I downloaded iTunes 7.0 on September 16th late at night. After downloading the upgrade I turned my laptop off and thought
-
Error 1406 when istalling itunes8. how do i fix?
When I try to install itunes I get the following error: Error 1406. Could not write value to key \Software\Classes\.cdda\OpenWithList\iTunes.exe. Verify that you have sufficient access to that key or contact your support personnel. How do I fix this
-
Is there a way for a SR Task to update the Install Base Status instance to Active
Release 12.1.3 When a field service install task is closed is there anyway for the Install Base instance on the SR to have its status updated to "Installed"?
-
830 vs. 930 vs. 1020 Please help me make a decisio...
Hi everyone. I am trying to make a buying decision between these 3 devices. Maybe you can help me out. Here are the guidelines of what I consider important (they are in order of importance): BATTERY - a) It's very important to me that the battery is
-
Z77A-GD65 build won't post, I've tried everything I can think of...
Hello all, Here are the parts: MSI Z77A-GD65 mobo Intel i5-3570K LGA 1155 MSI N560GTX-TiHawk graphics card Samsung 30nm DDR3 RAM 2x 4gb Corsair H100 cooling Samsung 830SSD Silverstone ST1000 1000watt power supply (this and my HDD are the only compone