Collect many workbook executions in one Excel file
My problem is to collect many workbook executions in only one excel file automatically, for example by broadcasting.
I explain the situation.
I have one (only) workbook to report the sales revenue by country. So by the input variable "country" I can have all the workbook reports needed.
By the broadcasting I can calculate and send them to the user.
But the user is one, the reports are many (30), and the mails are too many for him.
So he asked to have only one excel file with the requested reports over different sheets.
Anyone has a similar experience about?
Hi Sergio,
Try this program for creation of more one than one sheets in one excel.
This program works 2 sheets.you can do how much you want.
REPORT zpck_download_to_excel .
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,
flg_stop(1) TYPE c.
Internal table Declaration
DATA : t_excel_t076m LIKE t076m OCCURS 0 WITH HEADER LINE,
t_excel_tedst LIKE tedst OCCURS 0 WITH HEADER LINE.
TYPES: data1(1500) TYPE c,
ty TYPE TABLE OF data1.
DATA: it TYPE ty WITH HEADER LINE,
it_2 TYPE ty WITH HEADER LINE.
DATA: rec TYPE sy-tfill,
deli(1) TYPE c,
l_amt(18) TYPE c.
DATA: BEGIN OF hex,
tab TYPE x,
END OF hex.
DATA: l_rc TYPE i.
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 .
M A C R O Declaration
DEFINE ole_check_error.
if &1 ne 0.
message e002(zz) with &1.
exit.
endif.
END-OF-DEFINITION.
Fetching Data
SELECT * FROM t076m INTO TABLE t_excel_t076m.
SELECT * FROM tedst INTO TABLE t_excel_tedst.
LOOP AT t_excel_t076m.
CONCATENATE
t_excel_t076m-parart
t_excel_t076m-konto
t_excel_t076m-mwart
t_excel_t076m-mwsatz
t_excel_t076m-land1
t_excel_t076m-mwskz
INTO it
SEPARATED BY deli.
APPEND it.
CLEAR it.
ENDLOOP.
LOOP AT t_excel_tedst.
CONCATENATE
t_excel_tedst-rcvprt
t_excel_tedst-repid
t_excel_tedst-routidread
t_excel_tedst-routidwrit
INTO it_2
SEPARATED BY deli.
APPEND it_2.
CLEAR it_2.
ENDLOOP.
IF h_excel-header = space OR h_excel-handle = -1.
start Excel
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.
add a new workbook
CALL METHOD OF h_mapl 'Add' = h_map.
First Sheet
Name of the T076
gv_sheet_name = 'T076M'.
GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
PERFORM formatting_data.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = it[]
CHANGING
rc = l_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
OTHERS = 4.
Get the First row and col
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
Get the 255 row and col
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 5000
#2 = 6.
Select the Data
CALL METHOD OF h_excel 'Range' = range
EXPORTING
#1 = w_cell1
#2 = w_cell2.
CALL METHOD OF range 'Select'.
CALL METHOD OF worksheet 'Paste'.
Second Sheet
Name of the Tedst
gv_sheet_name = 'TEDST'.
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.
PERFORM formatting_data.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = it_2[]
CHANGING
rc = l_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
OTHERS = 4.
Get the First row and col
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
Get the 255 row and col
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 255
#2 = 6.
Select the Data
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.
*& Form formatting_data
FORM formatting_data.
*--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 .
ENDFORM. " formatting_data
Hope it helps you.
Reward your points if it is helpful.
Thanks,
Chitra
Similar Messages
-
How to download data in multiple sheets of one excel file
Hello,
I want to download data in multiple sheets of one excel file ..through ole2_object.
i have created program but it is not it is not giving the desird op.
here is the code..
create object excel 'EXCEL.APPLICATION'.
call method of excel 'WORKBOOKS' = books.
call method of books 'ADD' = book1.
*****************" Here we r creating the first sheet.
if flag1 = 'X'.
call method of book1 'WORKSHEETS' = SHEET
EXPORTING
#1 = 1. " here 1 indicating the position of sheet means first position.
call method of sheet 'Activate'.
set property of sheet 'Name' = 'Developments_Summary_Report'.
perform excel_fill.
endif.
*****************" Here we r creating the second sheet.
if flag2 = 'X'.
call method of book1 'WORKSHEETS' = SHEET
EXPORTING
#1 = 2. " here 2 indicating the position of sheet means second position.
call method of sheet 'Activate'.
set property of sheet 'Name' = 'BDC_Developments_Report'.
perform excel_fill.
endif.
set property of excel 'VISIBLE' = 1. " due to this property excel window is visible.
call method of excel 'QUIT'.
but it is generating the two different excel file ..
Thanks in advance,
Paresh.Hi,
Copy and paste this code in your SAP
*& Report ZETA_EXCEL_DOWNLOAD_CLIPBOARD *
report zeta_excel_download_clipboard .
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,
flg_stop(1) type c.
** Internal table Declaration
data: begin of t_excel occurs 0,
vkorg(20) type c, "Sales Org
vbtyp(20) type c, "Document Category
auart(20) type c, "Document Type
ernam(20) type c, "Created By
vbeln(20) type c, "Document Number
posnr(20) type c, "Item Number
erdat(20) type c, "Created Date
vdatu(20) type c, "Header Requested Delivery Date
reqdat(20) type c, "Request date
condat(20) type c, "Confirm date
lifsk(20) type c, "Header Block
txt30(30) type c, "Order User Status Description
lifsp(20) type c, "Line Block
dispo(20) type c, "MRP Controller
dsnam(20) type c, "MRP Controller Description
vmsta(20) type c, "Material Sales Status
kunnr(20) type c, "Sold To
cname(35) type c, "Sold To Name
regio(20) type c, "State
cufd(10) type c, "CUD
bstnk(20) type c, "PO#
bsark(20) type c, "Ordering Method
matnr(20) type c, "Material
maktx(35) type c, "Material Description
t200(20) type c, "T200
vtext(20) type c, "T200 Description
matkl(20) type c, "Material Group
zzbomind(7) type c, "BOM Indicator
ostat(20) type c, "Order Status
cmgst(20) type c, "CRD
inco1(20) type c, "Incoterms
oqty(20) type c, "Order Quantity
pqty(20) type c, "Open Quantity
unit(20) type c, "UOM
onet(20) type c, "Order Value
pnet(20) type c, "Open Value
curr(20) type c, "Currency key
so_bezei like tvkbt-bezei,"Sales Office
sg_bezei like tvgrt-bezei,"Sales Group
bname(20) type c, "Ordering Party
contact(20) type c, "Contact Name
telf1(20) type c, "Contact telf1
reqqty(20) type c, "Item Request qty
reqval(20) type c, "Item Request value
conqty(20) type c, "Item Confirm qty
conval(20) type c, "Item Confirm value
zzrev(02) type c, "Revenue recognition acceptance
bezei(20) type c, "Revenue recognition text
vgbel(20) type c, "Reference Order for RETURNS
0008text(255) type c, "Internal Order Comment Text
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.
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 .
* M A C R O Declaration
define ole_check_error.
if &1 ne 0.
message e001(zz) with &1.
exit.
endif.
end-of-definition.
t_excel_bckord-vkorg = 'ABC'.
t_excel_bckord-vbtyp = 'DEF'.
t_excel_bckord-auart = 'GHI'.
t_excel_bckord-ernam = 'JKL'.
t_excel_bckord-vbeln = 'MNO'.
t_excel_bckord-0008text = 'XYZ'.
append t_excel_bckord.
t_excel_bckord-vkorg = 'ABC1'.
t_excel_bckord-vbtyp = 'DEF1'.
t_excel_bckord-auart = 'GHI1'.
t_excel_bckord-ernam = 'JKL1'.
t_excel_bckord-vbeln = 'MNO1'.
t_excel_bckord-0008text = 'XYZ1'.
append t_excel_bckord.
t_excel_bckord-vkorg = 'ABC2'.
t_excel_bckord-vbtyp = 'DEF2'.
t_excel_bckord-auart = 'GHI2'.
t_excel_bckord-ernam = 'JKL2'.
t_excel_bckord-vbeln = 'MNO2'.
t_excel_bckord-0008text = 'XYZ2'.
append t_excel_bckord.
t_excel_bcklog-vkorg = 'ABC'.
t_excel_bcklog-vbtyp = 'DEF'.
t_excel_bcklog-auart = 'GHI'.
t_excel_bcklog-ernam = 'JKL'.
t_excel_bcklog-vbeln = 'MNO'.
t_excel_bcklog-0008text = 'XYZ'.
append t_excel_bcklog.
t_excel_bcklog-vkorg = 'ABC1'.
t_excel_bcklog-vbtyp = 'DEF1'.
t_excel_bcklog-auart = 'GHI1'.
t_excel_bcklog-ernam = 'JKL1'.
t_excel_bcklog-vbeln = 'MNO1'.
t_excel_bcklog-0008text = 'XYZ1'.
append t_excel_bcklog.
t_excel_bcklog-vkorg = 'ABC2'.
t_excel_bcklog-vbtyp = 'DEF2'.
t_excel_bcklog-auart = 'GHI2'.
t_excel_bcklog-ernam = 'JKL2'.
t_excel_bcklog-vbeln = 'MNO2'.
t_excel_bcklog-0008text = 'XYZ2'.
append t_excel_bcklog.
t_excel_bcklog-vkorg = 'ABC3'.
t_excel_bcklog-vbtyp = 'DEF3'..
t_excel_bcklog-auart = 'GHI3'.
t_excel_bcklog-ernam = 'JKL3'.
t_excel_bcklog-vbeln = 'MNO3'.
t_excel_bcklog-0008text = 'XYZ3'.
append t_excel_bcklog.
t_excel_blkord-vkorg = 'ABC'.
t_excel_blkord-vbtyp = 'DEF'.
t_excel_blkord-auart = 'GHI'.
t_excel_blkord-ernam = 'JKL'.
t_excel_blkord-vbeln = 'MNO'.
t_excel_blkord-0008text = 'XYZ'.
append t_excel_blkord.
t_excel_blkord-vkorg = 'ABC1'.
t_excel_blkord-vbtyp = 'DEF1'.
t_excel_blkord-auart = 'GHI1'.
t_excel_blkord-ernam = 'JKL1'.
t_excel_blkord-vbeln = 'MNO1'.
t_excel_blkord-0008text = 'XYZ1'.
append t_excel_blkord.
t_excel_blkord-vkorg = 'ABC2'.
t_excel_blkord-vbtyp = 'DEF2'.
t_excel_blkord-auart = 'GHI2'.
t_excel_blkord-ernam = 'JKL2'.
t_excel_blkord-vbeln = 'MNO2'.
t_excel_blkord-0008text = 'XYZ2'.
append t_excel_blkord.
t_excel_blkord-vkorg = 'ABC3'.
t_excel_blkord-vbtyp = 'DEF3'..
t_excel_blkord-auart = 'GHI3'.
t_excel_blkord-ernam = 'JKL3'.
t_excel_blkord-vbeln = 'MNO3'.
t_excel_blkord-0008text = 'XYZ3'.
append t_excel_blkord.
t_excel_blkord-vkorg = 'ABC4'.
t_excel_blkord-vbtyp = 'DEF4'..
t_excel_blkord-auart = 'GHI4'.
t_excel_blkord-ernam = 'JKL4'.
t_excel_blkord-vbeln = 'MNO4'.
t_excel_blkord-0008text = 'XYZ4'.
append t_excel_blkord.
loop at t_excel_bckord.
concatenate
t_excel_bckord-vkorg
t_excel_bckord-vbtyp
t_excel_bckord-auart
t_excel_bckord-ernam
t_excel_bckord-vbeln
t_excel_bckord-posnr
t_excel_bckord-erdat
t_excel_bckord-vdatu
t_excel_bckord-reqdat
t_excel_bckord-condat
t_excel_bckord-lifsk
t_excel_bckord-txt30
t_excel_bckord-lifsp
t_excel_bckord-dispo
t_excel_bckord-dsnam
t_excel_bckord-vmsta
t_excel_bckord-kunnr
t_excel_bckord-cname
t_excel_bckord-regio
t_excel_bckord-cufd
t_excel_bckord-bstnk
t_excel_bckord-bsark
t_excel_bckord-matnr
t_excel_bckord-maktx
t_excel_bckord-t200
t_excel_bckord-vtext
t_excel_bckord-matkl
t_excel_bckord-zzbomind
t_excel_bckord-ostat
t_excel_bckord-cmgst
t_excel_bckord-inco1
t_excel_bckord-oqty
t_excel_bckord-pqty
t_excel_bckord-unit
t_excel_bckord-onet
t_excel_bckord-pnet
t_excel_bckord-curr
t_excel_bckord-so_bezei
t_excel_bckord-sg_bezei
t_excel_bckord-bname
t_excel_bckord-contact
t_excel_bckord-telf1
t_excel_bckord-reqqty
t_excel_bckord-reqval
t_excel_bckord-conqty
t_excel_bckord-conval
t_excel_bckord-zzrev
t_excel_bckord-bezei
t_excel_bckord-vgbel
t_excel_bckord-0008text
into it
separated by deli.
append it.
clear it.
endloop.
loop at t_excel_bcklog.
concatenate
t_excel_bcklog-vkorg
t_excel_bcklog-vbtyp
t_excel_bcklog-auart
t_excel_bcklog-ernam
t_excel_bcklog-vbeln
t_excel_bcklog-posnr
t_excel_bcklog-erdat
t_excel_bcklog-vdatu
t_excel_bcklog-reqdat
t_excel_bcklog-condat
t_excel_bcklog-lifsk
t_excel_bcklog-txt30
t_excel_bcklog-lifsp
t_excel_bcklog-dispo
t_excel_bcklog-dsnam
t_excel_bcklog-vmsta
t_excel_bcklog-kunnr
t_excel_bcklog-cname
t_excel_bcklog-regio
t_excel_bcklog-cufd
t_excel_bcklog-bstnk
t_excel_bcklog-bsark
t_excel_bcklog-matnr
t_excel_bcklog-maktx
t_excel_bcklog-t200
t_excel_bcklog-vtext
t_excel_bcklog-matkl
t_excel_bcklog-zzbomind
t_excel_bcklog-ostat
t_excel_bcklog-cmgst
t_excel_bcklog-inco1
t_excel_bcklog-oqty
t_excel_bcklog-pqty
t_excel_bcklog-unit
t_excel_bcklog-onet
t_excel_bcklog-pnet
t_excel_bcklog-curr
t_excel_bcklog-so_bezei
t_excel_bcklog-sg_bezei
t_excel_bcklog-bname
t_excel_bcklog-contact
t_excel_bcklog-telf1
t_excel_bcklog-reqqty
t_excel_bcklog-reqval
t_excel_bcklog-conqty
t_excel_bcklog-conval
t_excel_bcklog-zzrev
t_excel_bcklog-bezei
t_excel_bcklog-vgbel
t_excel_bcklog-0008text
into it_2
separated by deli.
append it_2.
clear it_2.
endloop.
loop at t_excel_blkord.
concatenate
t_excel_blkord-vkorg
t_excel_blkord-vbtyp
t_excel_blkord-auart
t_excel_blkord-ernam
t_excel_blkord-vbeln
t_excel_blkord-posnr
t_excel_blkord-erdat
t_excel_blkord-vdatu
t_excel_blkord-reqdat
t_excel_blkord-condat
t_excel_blkord-lifsk
t_excel_blkord-txt30
t_excel_blkord-lifsp
t_excel_blkord-dispo
t_excel_blkord-dsnam
t_excel_blkord-vmsta
t_excel_blkord-kunnr
t_excel_blkord-cname
t_excel_blkord-regio
t_excel_blkord-cufd
t_excel_blkord-bstnk
t_excel_blkord-bsark
t_excel_blkord-matnr
t_excel_blkord-maktx
t_excel_blkord-t200
t_excel_blkord-vtext
t_excel_blkord-matkl
t_excel_blkord-zzbomind
t_excel_blkord-ostat
t_excel_blkord-cmgst
t_excel_blkord-inco1
t_excel_blkord-oqty
t_excel_blkord-pqty
t_excel_blkord-unit
t_excel_blkord-onet
t_excel_blkord-pnet
t_excel_blkord-curr
t_excel_blkord-so_bezei
t_excel_blkord-sg_bezei
t_excel_blkord-bname
t_excel_blkord-contact
t_excel_blkord-telf1
t_excel_blkord-reqqty
t_excel_blkord-reqval
t_excel_blkord-conqty
t_excel_blkord-conval
t_excel_blkord-zzrev
t_excel_blkord-bezei
t_excel_blkord-vgbel
t_excel_blkord-0008text
into it_3
separated by deli.
append it_3.
clear it_3.
endloop.
if h_excel-header = space or h_excel-handle = -1.
* start Excel
create object h_excel 'EXCEL.APPLICATION'.
endif.
* PERFORM err_hdl.
*--- get list of workbooks, initially empty
call method of h_excel 'Workbooks' = h_mapl.
* PERFORM err_hdl.
set property of h_excel 'Visible' = 1.
* add a new workbook
call method of h_mapl 'Add' = h_map.
* PERFORM err_hdl.
*GV_SHEET_NAME = '1st SHEET'.
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.
*CALL METHOD OF gs_cells 'Select' .
get property of h_cell 'Font' = gs_font .
set property of gs_font 'Bold' = 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.
* PERFORM err_hdl.
call method of h_excel 'Range' = range
exporting
#1 = w_cell1
#2 = w_cell2.
call method of range 'Select'.
* PERFORM err_hdl.
call method of worksheet 'Paste'.
* PERFORM err_hdl.
* CALL METHOD OF h_excel 'QUIT'.
*GV_SHEET_NAME = '2ND SHEET'.
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 .
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.
* PERFORM err_hdl.
call method of h_excel 'Range' = range
exporting
#1 = w_cell1
#2 = w_cell2.
call method of range 'Select'.
* PERFORM err_hdl.
call method of worksheet 'Paste'.
*GV_SHEET_NAME = '3rd SHEET'.
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 .
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.
* PERFORM err_hdl.
call method of h_excel 'Range' = range
exporting
#1 = w_cell1
#2 = w_cell2.
call method of range 'Select'.
* PERFORM err_hdl.
call method of worksheet 'Paste'.
*--- disconnect from Excel
free object h_zl.
free object h_mapl.
free object h_map.
free object h_excel.
Regards
Sudheer -
Can we combine multiple excel files into one excel file using SSIS?
I have a bunch of excel files in a specified folder. I wanted to combine all the excel files into one excel file by adding additional tabs in one excel file. Can I do this using SSIS?
OR
I know using macro we can combine multiple excel files. Can we run a excel macro in SSIS? Please help me.
Actually the complete package is this:
Step1: Using FTP task I'm downloading the bunch of excel files into a folder.
Step2: Above implementation is the second step that I have to do.You can do it in two steps
1. First get all data from excel sheets to a sql staging table. For that you need to use a looping logic as explained in below link (you dont required the additional logic used for checking file name etc in below example as you need all files). Also make
source as excel instead of flat file
http://visakhm.blogspot.in/2012/05/package-to-implement-daily-processing.html
2. Once you get the data onto a single table, use below to get it exported to multiple sheets within same excel destination file
http://visakhm.blogspot.in/2013/09/exporting-sqlserver-data-to-multiple.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Save multiple waveform graphs and data in one Excel File
Hi there,
I managed to save data from waveform graph into excel file and saving the plot into excel but individually. I'm aiming to save both the data and the plot in an excel file. May I know how do I do it? I've tried using the Write to Measurement File vi and also the invoke node of the waveform chart but it's still not giving me what I've wanted.
The above was only for one analog input channel and I have 2 analog inputs each with their respective sets of data and plot. Is there a way to execute the data and plot of one input in one worksheet and another set of data and plot in another worksheet, all in one excel file?Hi there;
I would recommend using the Report Generation Toolkit; it is the easiest way.
You can use either the Report Express VI or the Appi to save all your data in both formats
Greetings -
Best Practice for Many Complex Elements In One PNG File
I use Fireworks all the time, but I'm still embarrasingly ignorant on how to do some things property.
For instance, when I do mockups of a new customers homepage, there may be many small or medium sized complex objects on the page. By "objects" I mean like lots of modules advertising their different services, and each module has its own graphics, text, backgrounds, etc all with lots of different effects applied.
Should all of these things reside in one large png file, or does Fireworks offer some way for me to create some of these as separate png files and just drop an "instance" of them into the main file? I read something about adding files to the Common Library, but I will only need these files for one single customer so that may be overkill.
Or do I even need to worry about separating them at all and should just continue having everything for a single customer in one big single png file?
Please let me know if my question is not clear.In reading a bit further, it looks like a good option for me might be to just select everything that makes up a specific module and just "group" it. That way I can move it around and turn it off and on easier.
So I'm thinking that unless theres something Im going to reusing more than once in a document (which in this case I'm not) then its fine to have everything all in one png? And the only time I use the Common/Document Library is when i'm reusing things?
I'm just trying to wrap my head around what all my options are in Fireworks, as so far my experience is limited to just dragging around rectangles and shapes and stuff on one single canvas to create website mockups. -
Execution of one CLASS file ( a compiled program)
this is a ambiguse problem for me !!!!
i working with jsdk1.4.1 .
i can compile programs but can't perform them with "java" !!
this is error of it :
(( Exception in thread "main" java.lang.NoclassDefFoundError : file name ))
anyone can lead & help me !!!
Thank you for your responses .
F.HeidarySet your classpath.
-
Multi data providers (oracle DB and Excel file) in one BO report
I have to create one BO report. There is one Excel file, with Type, type_ID,(each type has many different type_ids), eg
type type_id
IHEI IHEI121
IHEI IHEI132
IHEI IHEI212
IHDI IHDI511
IHDI IHDI232
IDWU IDWU212
IDWU ...............
now I want to count the occurrences of these type_ids in the oracle database.
This should be relatively easy, with
select type, type_id, count(type_id)
from my_table
where type in ('IHEI', ...)
however, since the there are many more data in the database than in the Excel file, it will also count those type_ids that are not in the Excel file
So, how to get rid of those type_ids and keep only those coming from the Excel file?
thanks for your help!Hi Eric,
In the main report, bring in your table.field(s) etc.
Then create a sub report and hook it up to the Excel file.
Link the sub to the main and display (...by "Type" ? ...)
all the Type_ID's.
Happy Hunting,
The Panda -
Import many excel file into owb automatically
Is it possible to load several excel files in owb automatically?
I want to avoid the follow situation...
I have like 100 excel files I have to create 100 system dsn each pointing to one excel file.
Is it possible?
Thanksowb treat excel file as database. so you can keep your content in one excel but across different worksheet.
if you want to have multiple excel to be read by owb then create seperate dsn.
otherwise create flat files(pipe delimited) by SSIS service and use OWB to load data from flat files. -
What is the best way to read and manipulate large data in excel files and show them in Sharepoint
Hi ,
I have a large excel file that has 700,000 records in it. The excel file has a few columns that change every day.
What is the best way to read the data form the excel file in fastest and most efficient way.
2 nd Problem,
I have one excel file that has many rows each row contain some data that has certain keywords.
What I want is to segregate the data of rows into respective sheets(tabs ) in the workbook.
for example in rows have following data
1. Alfa
2beta
3 gama
4beta
5gama
6gama
7alfa
in excel
I want there to be 3 tabs now with each of the key words alfa beta and gamma.Hi,
I don't really see any better options for SharePoint. SharePoint use other production called 'Office Web App' to allow users to view/edit Microsoft Office documents (word, excel etc.). But the web version of excel doesn't support that much records as well
as there's size limitations (probably the default max size is 10MB).
Regarding second problem, I think you need some custom solutions (like a SharePoint timer job/webpart ) to read and present data.
However, if you can reduce the excel file records to something near 16k (which is supported rows in web version of excel) then you can use SharePoint Excel service to refresh data automatically in the excel file in SharePoint from some external sources.
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com -
How to Open Two Excel Files in Multiple Monitors in Windows 7
How to open two excel files in two excel windows using multiple monitors in Windows 7.
Currently it opens multiple files on top of each other on the same one monitor.
I found this article in a blog it says
"The snap feature that you are looking for will not work unless you open two instances of Excel. This is because Excel Unlike Word is not a True SDI Application. Microsoft is aware of the Issue however there is no resolution to the problem but the workaround"If you are working almost the entire day in front of your computer at your office with lots of Excel Sheets and Word, then probably you might be working with a
dual monitor or may be even more than that. Studies have shown that having an additional monitor increases the productivity by 20 to 30 percent (Source: NY Times)
But some applications like MS Office Excel, even though you open multiple files, they are all from the same instance of the application. So if you want to compare two
Excel
files, then you may not be able to have it in two
separate monitors as the files are loaded using the same instance of Excel. If you move one
Excel
file to the other window, the other Excel files are also moved to the other window.
So how to have two separate Excel files or other application side by side in dual monitors?
Option A:
In Excel 2003, go to Tools -> Options ->
General tab.
Make sure the option, ‘Ignore other applications’ is checked. Now all the Excel files will be opened as separate instance and you can move the Excel files individually across the monitors.
In Excel 2007, Click the Office button ->
Excel Options -> Advanced.
Under General, check ‘Ignore other applications that use Dynamic Data Exchange’.
or
As this method forces each Excel file as a separate instance, the memory consumption will be more. If you don’t want too many memory consumption then you can open only two instances (see
Option B) and manage wisely to view in both the monitors.
Note: If you are having issues like Excel opens without displaying a workbook, then you may have to
uncheck this option. (See Microsoft Help for more details on this). You can use option B in this case. I have this option checked and I have not faced any issue yet.
Option B:
They key here is, the application has to be loaded as separate instances. Lets say you have opened an Excel file in
Monitor 1 and you want to open the next excel file in Monitor 2. You can usually open another instance of Excel by browsing through the
Start Menu -> Programs -> Microsoft Office ->
Excel. Make sure this newly opened Excel file is the last Excel file you had viewed and then double click on the Excel file that you wanted to open. This will force the Excel to
open
in the second instance of Excel. Now you can move these
two excel files separately across windows or monitors.
This may be little cumbersome way to open new instances of Excel every time. The easy solution would be to keep these links in the
quick links near the Start button. So, every time you want to open a new instance of the application, you can just use those quick links.
hope work thanks
http://www.lytebyte.com/2008/05/13/how-to-open-two-excel-files-side-by-side-in-separate-monitors/ -
34,000 page excel file needs to be converted to pdf
I have a 34,000 page excel file that I need to convert to pdf. The excel file is 13mb. I'm using excel 2013 on Win 7.
Within excel, I have tried Save As pdf. It has never finished. I've let it run all day and night, but it gets to about 90% and hangs.
Last night, I tried converting it within Adobe (let it run all night), and found that it had crashed some time over night.
I really want this to be one pdf since it's one excel file and it would be simpler for traceability and audit purposes.
My questions are:
1. Is there a maximum file size or page limit to conversions?
2. Any suggestions on how to convert this into one pdf file?
Thank you!!That's a large file. PDFs can have many more pages than that though, so it's not due to a limitation of PDF. As a test, are you able to select fewer pages to convert to see how it goes?
-
How to create reports using excel files In OBIEE
I have data in only one excel file,how to create reports in OBIEE..I need to Prompt aslo in this report .
I have requirements prompt also , Prompt name :Year, Month ,Day , how to create reports
ThanksHi,
Create similar kind of joins which you make after importing physical tables from db.
There is no difference in making joins in the excel. (both physical and BMM layers).
But always remember there are many limitations for having excel as database.
Also refer
http://obiee-blog.info/bugs-and-issues/obiee-not-supporting-excel/
Regards,
MuRam -
Please Help. compare two excel files. Can't get the find command to work
Hello, I'm new to applescript. I'm trying to write a script to compare column B of one excel file to column B of the another excel file.
I will have to had a repeat loop to proceed down the column but I'm stuck on the find command.
Below is some of the code I have so far. The applescript error message is "Microsoft Excel got an error: The object you are trying to access does not exist. It highlights the find column."
set patientFile to choose file with prompt "Please select the patient Excel file:"
set patientName to name of (info for patientFile)
tell application "Microsoft Excel"
open patientFile
set thepatientFile to workbook patientName
end tell
display dialog "Is your patient SNP data in column B of the " & " " & patientName & " " & "excel file?" buttons {"No", "Yes"} default button 2
if the button returned of the result is "No" then
display dialog "Please put your data in column B" buttons {"Cancel"} default button 1
if the button returned of the result is "Cancel" then
end if
else
display dialog "Is column E empty? The results of this program will be stored in column E of the" & " " & patientName & " " & "excel file." buttons {"No", "Yes"} default button 2
if the button returned of the result is "No" then
display dialog "Please put your data in empty column E" buttons {"Cancel"} default button 1
if the button returned of the result is "Cancel" then
end if
else
set relativeFile to choose file with prompt "Please select the relative Excel file:"
set relativeName to name of (info for relativeFile)
tell application "Microsoft Excel"
open relativeFile
set therelativeFile to workbook relativeName
end tell
end if
end if
display dialog "Is your relative SNP data in column B of the" & " " & relativeName & " " & "excel file?" buttons {"No", "Yes"} default button 2
if the button returned of the result is "No" then
display dialog "Please put your data in column B" buttons {"Cancel"} default button 1
if the button returned of the result is "Cancel" then
end if
else
display dialog "Does column C contain the result data you would like copied from" & " " & relativeName & " " & "excel file?" buttons {"No", "Yes"} default button 2
if the button returned of the result is "No" then
display dialog "Please put the data you would like copied in column C." buttons {"Cancel"} default button 1
if the button returned of the result is "Cancel" then
end if
else
tell application "Microsoft Excel"
activate object workbook patientName
copy value of cell "A1" to cellPatientFile
find (range "B:B" of workbook relativeName) what cellPatientFile
if cellPatientFile is true then
set bold of font object of cellPatientFile to true
end if
end tell
end if
end if
Does any one have any hints towards solving this problem? Thank you for any help.Hi,
taffners wrote:
Thank you everyone for your help. I attached my code. It works now but kinda slow. Does anyone have any hints on making it faster.
Important : when you use the find command, it's preferable to use the properties ( look in and look at).
Example : find searchRange what searchTerm look in values look at whole
Otherwise, it will search according to the criteria of your last find.
Example, if you uncheck 'Find entire cells only', and after that you run the script,
find column 2 what 10.0 --> match 110.0 or 1110.0 or 310.0, .... , because it look at part.
set screen updating to false : Yes it improves the speed.
Here are my tests (no duplicate values in the Excel column ) on old computer (Powermac G5) .
set screen updating to false without any activate object command
2000 rows --> 3.7 minutes, your script : 11.5 minutes
4000 rows --> 7.5 minutes, your script : 23 minutes
8000 rows --> 15 minutes, your script : 46 minutes
But, it's faster to search through a list without using the Excel find command, no need to set the screen updating, You can continue working on the workbook or another workbook, this will not disturb the script.
Tests on my script :
2000 rows --> 4 seconds
4000 rows --> 21 seconds
8000 rows --> 1.3 minutes
17000 rows --> 6 minutes
Here is the script :
main()
display dialog "Done"
on main()
script o
property patientSNP_list : {}
property relativeSNP_list : {}
property resultsList : {}
property copyAnswerList : {}
on findLookAtWhole(value) -- case sensitive
set {low, high} to {1, count my relativeSNP_list}
considering case
repeat while low ≠ high
set mid_ to (low + high) div 2
if value is in items low thru mid_ of my relativeSNP_list then
set high to mid_
else
set low to mid_ + 1
end if
end repeat
end considering
if (item low of my relativeSNP_list is value) then
set end of my resultsList to item low of my copyAnswerList
else
set end of my resultsList to {"no"}
end if
end findLookAtWhole
end script
--opens File1. Names it patientName
set patientFile to choose file with prompt "Please select the patient Excel file:"
set patientName to name of (info for patientFile)
tell application "Microsoft Excel"
open patientFile
set thepatientFile to workbook patientName
set patientSheet to sheet (name of active sheet) of thepatientFile
end tell
--This Dialog assigns where the data is stored for file1
display dialog "What Column is your patient SNP data of the " & " " & patientName & " " & "excel file?" default answer "" buttons {"submit"} default button 1
set PatientSNPCol to (text returned of the result)
--This Dialog assigns what row your data starts at for file1
display dialog "What row does your patient SNP data start in the " & " " & patientName & " " & "excel file?" default answer "" buttons {"submit"} default button 1
set patientSNPRow to (text returned of the result)
set patientStartCell to PatientSNPCol & patientSNPRow
--This Dialog assigns the last row of data for file1
display dialog "What row is the last row of you patient SNP data start of the " & " " & patientName & " " & "excel file?" default answer "" buttons {"submit"} default button 1
set patientLastRow to (text returned of the result)
set patientLastCell to PatientSNPCol & patientLastRow
--This Dialog assigns the location of the data copied from file2
display dialog "What column would you like the results of this program stored in of the" & " " & patientName & " " & "excel file." default answer "" buttons {"submit"} default button 1
set resultsLocation to (text returned of the result)
--opens File2. Names it relativeName
set relativeFile to choose file with prompt "Please select the relative Excel file:"
set relativeName to name of (info for relativeFile)
tell application "Microsoft Excel"
open relativeFile
set therelativeFile to workbook relativeName
set relativeSheet to sheet (name of active sheet) of therelativeFile
end tell
--This dialog assigns the column of data in file2
display dialog "What Column is your relative SNP data of the " & " " & relativeName & " " & "excel file?" default answer "" buttons {"submit"} default button 1
set relativeSNPCol to (text returned of the result)
--This dialog assigns the column of data begining copied to excel file1.
display dialog "What Column contains the data you would like copied to the " & " " & patientName & " " & "excel file in column" & " " & resultsLocation & " " & "?" default answer "" buttons {"submit"} default button 1
set copyAnswer to (text returned of the result)
tell application "Microsoft Excel" -- get values
set o's patientSNP_list to value of range (PatientSNPCol & patientSNPRow & ":" & PatientSNPCol & patientLastRow) of patientSheet
set lastrow to first row index of (last cell of used range of relativeSheet)
set o's relativeSNP_list to value of range (relativeSNPCol & "1:" & relativeSNPCol & lastrow) of relativeSheet
set o's copyAnswerList to value of range (copyAnswer & "1:" & copyAnswer & lastrow) of relativeSheet
end tell
set tc to (count o's relativeSNP_list)
repeat with i from 1 to tc --convert list of lists to one list
set item i of o's relativeSNP_list to item 1 of item i of o's relativeSNP_list
end repeat
set tc to (count o's patientSNP_list)
repeat with i from 1 to tc -- AppleScript find method, not the Excel Find
o's findLookAtWhole(item 1 of (item i of o's patientSNP_list))
end repeat
tell application "Microsoft Excel" -- set values
set value of range (resultsLocation & patientSNPRow & ":" & resultsLocation & patientLastRow) of patientSheet to o's resultsList
end tell
end main
If you have lots of rows and you want it to go faster.
I have another script that uses the power of (/usr/bin/awk and his associative arrays) in a do shell script
17000 rows --> awk : 2 seconds, applescript : 6 seconds, total : 8 seconds
34000 rows --> awk : 3 seconds, applescript : 11 seconds, total : 14 seconds -
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 -
Function module to get data into internal table from Excel file sheets
Hi,
I have to upload customers from excel file.
we are donloading customer data excel file sheets.
Customer data in 1 sheet, tax data the other sheet of same excel file, Customer master-Credit data in other sheet of same excel file.
so i have 3-4 sheet in one excel file.
now my requirement is to get the data from excel file into internal table.
is there any function module.
Thanks & RegardsI am sending you the idea with an example how you can upload data from an EXCEL file into an internal table. I am not sure if you can take data from different sheet in the same EXCEL file. I think that this is not possible (try it )
Upload the data into an internal table, like the way that I am describing in the above:
DATA: L_MAX_COL_NB TYPE I.
DATA: l_file_name LIKE RLGRAP-FILENAME.
Just to be sure that is the correct type for the FM.
l_file_name = P_FILE_NAME.
L_MAX_COL_NB = 58. "Maximum nb of colums that the FM can read.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = l_file_name
I_BEGIN_COL = 1
I_BEGIN_ROW = 2
I_END_COL = L_MAX_COL_NB
I_END_ROW = 9999
TABLES
INTERN = PT_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
ENDIF.
Now you should upload the data into your own itab. The Function Module will return to you all the an itab
from all fields and columns. Define the structure of the uploading file into SE11 - Data Dictionary. Then read the fieldcatalog of this structure. In the code that I am sending to you, I am insearting an empty line into the internal table and then I am assigning this line into a corresponding field-symbol. Then I am able to change the working area - so and the line of the itab. Propably you could you the statement APPEND INITIAL LINE TO (your_table_name) ASSIGNING <your_field_symbol>, but the example was written in an old SAP version.
FIELD-SYMBOLS:
<F_REC> LIKE WA_UPLOAD_FILE, "working are of the uploading file
<F_FIELD> TYPE ANY.
DATA: COLUMN_INT TYPE I,
C_FIELDNAME(30) TYPE C.
PERFORM GET_FIELDCATOLG TABLES FIELDCAT
USING 'ZECO_CHARALAMBOUS_FILE'.
LOOP AT PT_EXCEL.
AT NEW ROW.
ASSIGN WA_UPLOAD_FILE TO <F_REC>.
ENDAT.
COLUMN_INT = PT_EXCEL-COL.
READ TABLE FIELDCAT INTO WA_FIELDCAT INDEX COLUMN_INT.
CONCATENATE '<F_REC>-' WA_FIELDCAT-FIELDNAME INTO C_FIELDNAME.
ASSIGN (C_FIELDNAME) TO <F_FIELD>.
<F_FIELD> = PT_EXCEL-VALUE.
AT END OF ROW.
APPEND WA_UPLOAD_FILE TO GT_UPLOAD_FILE.
CLEAR WA_UPLOAD_FILE.
ENDAT.
ENDLOOP.
With Regards
George
Edited by: giorgos michaelaris on Mar 4, 2010 3:44 PM
Maybe you are looking for
-
Kernel Panic after 10.4.8 update
Used Software Update to update all the new software today. I had to leave the house before the OS X install finished so I pluged the computer in and left. When I retunred I see an error telling me the installation failed and the package has been move
-
Issue with download of Adobe Captivate 8
Hi at all! I have one issue really strange. I have tried to download Adobe Captivate 8 on Adobe's website. But when I click on the button "install now" suddetly one window appairs and it ask me the path of the computer for to save my file. When I cho
-
Hi, i am encountering a strange problem. I am trying to run quartz (java application) on oc4j server. When i have all the quartz classes in web-inf/classes folder, the application runs fine, but the moment i make a jar out of all classes and put the
-
Viewing uploaded photos from ipad on PC
I want to see photos I took with my ipad mini on my laptop PC which is has windows 7. I have download the icloud feature on it. And I set up a beta library on my Mini ipad and think it uploaded my photos. but I don't know what to do now to look at
-
How can i get help with my email.
I can't get anything of my email via firefox ... I can read my email via yahoo app or i have to go to inter explorer .. I need help with this problem please . The option are there but once I click on any of them nothing cones up. Can someone please h