Excel sheet download
hi experts,
i need to shedule a report in back ground which has to download a excel sheet
on my presentation server i know we cannot get it directly.
if we have done it to application layer how can we get it to presentation layer
can we code it in same report which is sheduled in backgrund r we need to do another code
plz help i got struct at this point
Hi,
Just search for the "GUI_DOWNLOAD" in the forums and you will get lots of examples for this.
You will not have much difference from using the CG3Y of CG3Z transactions or writing the program as you will have to run the program in the <b>foreground</b> only to download the file.
I cannot give you the code now as I do not have access to SAP right now.
Similar Messages
-
Excel sheet download problem from ALV
Hi all,
when i am trying to download an ALV report into localfile... Excel, two middle coloum values are not appeared in excel sheet but headings are available.
last three coloums values are overlapped in these headings.
Where might be the problem exist?Hi,
Reprots
http://www.sapgenie.com/abap/reports.htm
http://www.allsaplinks.com/material.html
http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV? http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV? http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV? http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Check this for basic concepts of OOPS
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
Tabstrip
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf
Editable ALV
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc
Tree
http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
General Tutorial for OOPS
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf
http://www.sapdevelopment.co.uk/reporting/alvhome.htm
http://www.sap-img.com/abap/what-is-alv-programming.htm
http://www.sap-img.com/abap-function.htm
http://www.geocities.com/mpioud/Abap_programs.html
http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf
http://www.sap-img.com/abap-function.htm -
SAP Query : Excel sheet download problem
Hi,
While executing a Z SAP query in SQ01 and data is displaying fine in the ALV format. But when we export the data to excel sheet, every column is appearing twice (repeating only the header, with empty items)
something like this......
Excel sheet...
Header MATNR MATNR MATKX MATKX LIFNR LIFNR KUNNR KUNNR
Item 10 Test ABC ABC
20 Test2 XYZ XYZ
30 Test3 MNO MNO
What can be possible cause of this ? What can be the corrective step to the issue?
Thanks,
JaiHi ,
Please follow the below step .
In SQ01 --> In the List Display screen --> click on Export --> Local file --> Spread Sheet --> Give the File name and click on generate .
It s working file . and i can be able to download all the records to excel without any repeatation .
Thanks
Pavendhan -
Is there any function module which can help me download data from an internal table into mutiple sheets on an excel workbook ?
My internal table contains more than 65536 records.Check it out !!
*& Report Y_EXCEL_MULTIPLE *
REPORT Y_EXCEL_MULTIPLE.
parameters: p_fname like RLGRAP-FILENAME
default 'C:\temp\testNN.xls'.
data: fname like p_fname,
kn like sy-repid.
data: cnt type i value 0.
data: sheetname(10) value 'TEST ',c_row type i,
scnt type i,
val(20), wb(2).
parameters: p_exvis as checkbox default 'X',
p_workbk(2) type p default '01',
p_wsheet(2) type p default '01'.
CONSTANTS: OK TYPE I VALUE 0.
INCLUDE OLE2INCL.
DATA: EXCEL TYPE OLE2_OBJECT,
WORKBOOK TYPE OLE2_OBJECT,
SHEET TYPE OLE2_OBJECT,
CELL TYPE OLE2_OBJECT,
CELL1 TYPE OLE2_OBJECT,
COLUMN TYPE OLE2_OBJECT,
RANGE TYPE OLE2_OBJECT,
BORDERS TYPE OLE2_OBJECT,
button TYPE OLE2_OBJECT,
int TYPE OLE2_OBJECT,
FONT TYPE OLE2_OBJECT,
ROW TYPE OLE2_OBJECT.
data: application type ole2_object,
book type ole2_object,
books type ole2_object.
data: ole_book TYPE ole2_object.
do p_workbk times.
move p_fname to fname.
unpack sy-index to wb.
replace 'NN' with wb into fname.
perform create_EXCEL.
create sheets and save
perform sheet.
perform save_book.
enddo.
write: ' Done'.
FORM create_excel *
form create_excel.
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 .
Put Excel in background
if p_exvis eq 'X'.
SET PROPERTY OF EXCEL 'VISIBLE' = 1.
else.
SET PROPERTY OF EXCEL 'VISIBLE' = 0.
endif.
Create worksheet
set property of excel 'SheetsInNewWorkbook' = 1.
call method of workbook 'ADD'.
endform.
FORM save_book *
form save_book.
get property of excel 'ActiveSheet' = sheet.
free object sheet.
free object workbook.
GET PROPERTY OF EXCEL 'ActiveWorkbook' = WORKBOOK.
call method of workbook 'SAVEAS' exporting #1 = p_fname #2 = 1.
call method of workbook 'CLOSE'.
call method of excel 'QUIT'.
free object sheet.
free object workbook.
free object excel.
endform.
FORM sheet *
form sheet.
do p_wsheet times.
unpack sy-index to sheetname+5(2).
if sy-index gt 1.
CALL METHOD OF EXCEL 'WORKSHEETS' = sheet.
call method of sheet 'ADD'.
free object sheet.
endif.
scnt = sy-index.
call method of excel 'WORKSHEETS' = SHEET EXPORTING #1 = scnt.
call method of sheet 'ACTIVATE'.
SET PROPERTY OF SHEET 'NAME' = sheetname.
free object sheet. "OK
perform fill_sheet.
CALL METHOD OF EXCEL 'Columns' = COLUMN.
CALL METHOD OF COLUMN 'Autofit'.
free object COLUMN.
call method of sheet 'BUTTON' = button.
call method of button 'ADD'.
set property of button 'fmButtonStyle' = 0.
exporting #1 = '96.75' #2 = '372' #3 = '123.75' #4 = '12'.
set property of button 'Characters' = 'ButtonTest'.
free object button.
free object font.
free object int.
free object cell.
free object: cell1.
free object range.
free object borders.
free object: column, row.
enddo.
free object font.
free object int.
free object cell.
free object cell1.
free object range.
free object borders.
free object column.
free object row.
free object sheet.
endform.
FORM border *
--> we *
form border using we.
*left
call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'.
set property of borders 'LineStyle' = '1'.
set property of borders 'WEIGHT' = we. "4=max
free object borders.
right
call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'.
set property of borders 'LineStyle' = '2'.
set property of borders 'WEIGHT' = we.
free object borders.
top
call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'.
set property of borders 'LineStyle' = '3'.
set property of borders 'WEIGHT' = we.
free object borders.
bottom
call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'.
set property of borders 'LineStyle' = '4'.
set property of borders 'WEIGHT' = we.
set property of borders 'ColorIndex' = 'xlAutomatic'.
free object borders.
endform.
FORM border2 *
--> we *
form border2 using we.
*left
call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'.
set property of borders 'LineStyle' = '5'.
set property of borders 'WEIGHT' = we. "4=max
free object borders.
right
call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'.
set property of borders 'LineStyle' = '6'.
set property of borders 'WEIGHT' = we.
free object borders.
top
call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'.
set property of borders 'LineStyle' = '7'.
set property of borders 'WEIGHT' = we.
free object borders.
bottom
call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'.
set property of borders 'LineStyle' = '8'.
set property of borders 'WEIGHT' = we.
set property of borders 'ColorIndex' = 'xlAutomatic'.
free object borders.
endform.
FORM border3 *
--> we *
form border3 using we.
*left
call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'.
set property of borders 'LineStyle' = '9'.
set property of borders 'WEIGHT' = we. "4=max
free object borders.
right
call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'.
set property of borders 'LineStyle' = '10'.
set property of borders 'WEIGHT' = we.
free object borders.
top
call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'.
set property of borders 'LineStyle' = '11'.
set property of borders 'WEIGHT' = we.
free object borders.
bottom
call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'.
set property of borders 'LineStyle' = '12'.
set property of borders 'WEIGHT' = we.
set property of borders 'ColorIndex' = 'xlAutomatic'.
free object borders.
endform.
FORM fill_cell *
--> color *
--> pattern *
form fill_cell using color pattern.
call method of cell 'INTERIOR' = int.
set property of int 'ColorIndex' = color.
set property of int 'Pattern' = pattern.
free object int.
endform.
FORM font *
--> bold *
--> size *
form font using bold size.
call method of CELL 'FONT' = font.
set property of font 'BOLD' = bold.
set property of font 'SIZE' = size.
free object font.
endform.
FORM fill_sheet *
form fill_sheet.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'A1'.
perform font using 1 '14'.
SET PROPERTY OF CELL 'VALUE' = 'Counter'.
perform fill_cell using '15' '1'.
perform border using '2'.
free object cell.
val = 'Workbook-Count'.
move wb to val+16.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'B1'.
SET PROPERTY OF CELL 'VALUE' = val.
perform fill_cell using '14' '1'.
perform border using '4'.
free object cell.
val = 'Sheet-Count'.
unpack sy-index to val+12.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'C1'.
SET PROPERTY OF CELL 'VALUE' = val.
perform fill_cell using '12' '1'.
perform border using '4'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'E3'.
perform border using '1'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'E5'.
perform border using '2'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'E7'.
perform border using '3'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'E9'.
perform border using '4'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'F3'.
perform border2 using '1'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'F5'.
perform border2 using '2'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'F7'.
perform border2 using '3'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'F9'.
perform border2 using '4'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'G3'.
perform border3 using '1'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'G5'.
perform border3 using '2'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'G7'.
perform border3 using '3'.
free object cell.
CALL METHOD OF EXCEL 'RANGE' = CELL EXPORTING #1 = 'G9'.
perform border3 using '4'.
free object cell.
val = 'ROW-Count'.
do 19 times.
c_row = sy-index + 1.
unpack c_row to val+12(4).
CALL METHOD OF excel 'CELLS' = CELL1 EXPORTING #1 = c_row #2 = 2.
SET PROPERTY OF CELL1 'VALUE' = val.
free object cell1.
CALL METHOD OF excel 'CELLS' = CELL1 EXPORTING #1 = c_row #2 = 4.
SET PROPERTY OF CELL1 'VALUE' = val.
free object cell1.
enddo.
endform.
You find SAP OLE programs under development Class 'SOLE' *
MSTAPPL Table Maintenance APPL *
RSOLEDOC Document list *
RSOLEIN0 OLE Load Type Information *
RSOLEINT Type Info Loaded *
RSOLETI0 OLE Object Browser *
RSOLETI1 OLE Object Browser *
RSOLETI2 OLE Object Browser *
RSOLETI3 F4 Help For OLE Objects *
RSOLETT1 OLE 2.0 Automation Demo Program *
Transactions: *
SOLE *
SOLO - List of OLE applcations with loaded type info *
You will find the decription of possible objects and methods in the *
windows help file for excel. *
Hope thisll give you idea!!
<b>P.S award the points.!!! !!!</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise" -
Alv Grid to Excel Sheet Downloading problem for Bank account Number(CHAR18)
Hi every one,
I am downloading Alv grid to excel using local file---> spreadsheet
but, the bank account no is populating as like ''11+E213". When press F2 in that column then only its showing the correct value.
If i do download directly from ctrlshiftF7 , its down loading perfectly but my user Needs the Header of the ALV also, Buecause HEader Consists of Payment Date and all details.
I have checked the same from the Satandard table also its also populating in the same way as in the report,
So if any body have valueble suggestions, Please reply soon,
Thanks & Regards,
Raj SHi Lalit,
Thanks for Ur promt reply,
I ahve alraedy Changed the lenght to 25 but it doesnot effect,
But when i concatenate the same number with any one character in front of the A/C No. Its generating perfectly,
But i cant do so as its an account No.
Thanks,
Raj S -
Unable to download the data perfectly into excel sheet
Hi Frnds,
when i am trying to download the data from the output of a report into excel, some of the records(line items/rows) are getting stored in one of column of the excel sheet. Fog eg: my report outputs 500 line items. In excel after 100 rows the next 5-10 records/rows are storing in one column. so at the end of excel sheet i may not find total 500 records/line items.
Plz suggest me how to handle this.
Thnks,
Pavan*& 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. -
Download greater than 255 characters from alv into excel sheet
Hi,
I have an ALV grid display report where the last field contains close to 600 characters of text.
When I use the Export -> Local File -> Spreadsheet option and save it in an excel sheet, only first 255 characters are getting downloaded into excelsheet and rest is not gettting downloaded.
Solution I have is: Keep a button on the screen. If that button is clicked, use GUI_DOWNLOAD FM and the entire text (all 600 chars) gets downloaded.
Is there any other solution to the above problem?
I tried downloading the alv report into XML format and opened as an excel document, but even then only first 255 characters are apearing in excel cell.
The domain has length 2048 chars for the final internal table in alv, so there is no problem with data element or domain.
OIn debugging mode, I am able to see all the 600 chars in the final internal table before alv display.
It looks like there is a constraint in alv that is can display only 255 characters in a cell.
ALso, I tried converting the grid display to list display and then download into excel , but the result is same.
Please help.please search first:
http://www.sdn.sap.com/irj/scn/advancedsearch;jsessionid=%28J2EE3417400%29ID0634234250DB10563517489488469157End?query=downloadmorethan255char -
Downloading records in in excel sheet from ALV.
Hi,
I am downloading Records from ALV GRID DIsplay to Excel sheet but i am unable to get all records that are displayed in ALV report.
I am getting only 73 records if i have only 180
Any inputs please for correctine the error
Regards
Rasheed.hi
you can follow these stapes and get ur work done
go to List > select Export > Spreadsheet or just click the excel icon from the tool bar.This would download the data to excel.
hope this helps
regards
Aakash Banga -
How to download the ALV output with colors into the excel sheet
Hi,
I'm having an ALV Grid report output where each and every row has some colors in it. When i download it to an excel sheet whatever the colors that comes on the output of the report the same should come in the excel sheet. When i download the output to an excel sheet using List --> Export -->Local file . If i open the excel files no colors are coming in the excel sheet.
can anyone tell how to get the colors in the excel sheet also. thanks...
Regards,
Rose.Hi Camila,
Use the OLE concept.
Check the below threads:
Colors in Excel Sheet
colors in alv
Regards,
Soumya. -
Avoid splitting of columns ALV report while download output to Excel sheet
Hi friends,
I have 170 columns in my ALV report
while downloading the report to Excel sheet
the column descriptions and values are splitting in two lines.
How can i avoid the problem.
before calling REUSE_ALV_GRID_DISPLAY function module in my code
for the Layout i assigned LS_LAYOUT-MAX_SIZE = 1023.
but still the problem is not solved.
Please help me in this Issue.
Thanks in Advance,
GaneshHi friends,
I dont want to use and Keyboard shiftcntrl....
or dont want to change any code in ALV report
by simply assigning some value to any of the export parameter in ALV function module
can we achieve the functionality
Thanks in Advance,
Ganesh -
Alv output download to excel sheet spliting into three line
hi,
i have developed alv report with 62 fields (62 colums).when i download this output into excel sheet each line spliting into three line.each field has 20 char length.i want download each row as single line.
i am using local file (ctrl + shift+F9) -> spreadsheet option
please advice me to solve this issue. i am using fm REUSE_ALV_GRID_DISPLAY.
In layout i am using
DATA: min_linesize like sy-linsz, " if initial min_linesize = 80
max_linesize like sy-linsz. " Default 250
min_linesize = 100.
max_linesize = 1000.
gt_layout-zebra = 'X'. "space.
gt_layout-colwidth_optimize = space.
gt_layout-max_linesize = min_linesize.
gt_layout-max_linesize = max_linesize.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_bypassing_buffer = ' '
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET-PF-STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = gt_fieldcat[]
it_events = gt_events[]
is_layout = gt_layout
is_variant = v_stru_disvar
i_default = 'X'
i_save = 'A'
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final[]
EXCEPTIONS
program_error = 1
OTHERS = 2
Edited by: Raja Ram on Aug 4, 2009 12:40 PMsolved
-
Download to excel sheet from ALV Grid report
Hi,
I need to download 3 lakhs of data to excel sheet but the constraint is that excel is having max limit of 65000 line items.
So i need to know the way in which i can create more than one sheet in excel while downloading so that each sheet can hold upto 65000 line items.
i need to create atleast 6 sheets in excel while downloading from report.
please help.Hi,
While downloading the data, it will prompt you save the list in file - Uncoverted, Spreadsheet, Rich text format, HTML format, Copy to Clipboard.
Why don't you try using Uncoverted format and give extension as .txt file.
So that you can download all 3 lacs of records.
Even if you use any FM, it will indirectly use excel for downloading and it will have restriction of having 65000 records only.
Thanks,
Sriram Ponna. -
Download from ALV to excel sheet.
When i am downloading the Alv to excel sheet. I want to get the field descritption also in the excel sheet.
Refer:
https://forums.sdn.sap.com/click.jspa?searchID=14433981&messageID=3603627 -
Field names are not getting into excel sheet while download
Hi All,
I am using gui_download fm to download internal table data to excel sheet.
have passed fieldnames parameter also.
defined each column with char type and length of those descriptions also.
but while downloading only first column description is getting.
Please help me.
Thanks in advance.
Regards,
eswarhi,
check this sample code.
DATA : BEGIN OF it_join_fields OCCURS 0,
field_name(20),
END OF it_join_fields.
CLEAR it_join_fields.
it_join_fields-field_name = 'pernr'.
APPEND it_join_fields.
CLEAR it_join_fields.
it_join_fields-field_name = 'empname'.
APPEND it_join_fields.
CLEAR it_join_fields.
it_join_fields-field_name = 'new_joinee'.
APPEND it_join_fields.
CLEAR it_join_fields.
it_join_fields-field_name = 'begda'.
APPEND it_join_fields.
CLEAR it_join_fields.
it_join_fields-field_name = 'fath_name'.
APPEND it_join_fields.
CLEAR it_join_fields.
CLEAR it_join_fields.
it_join_fields-field_name = 'gbdat'.
APPEND it_join_fields.
CLEAR it_join_fields.
it_join_fields-field_name = 'gesch'.
APPEND it_join_fields.
CLEAR it_join_fields.
it_join_fields-field_name = 'usrid_long'.
APPEND it_join_fields.
CLEAR it_join_fields.
it_join_fields-field_name = 'werks'.
APPEND it_join_fields.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = file_name
filetype = 'ASC'
append = 'X'
write_field_separator = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
TABLES
data_tab = it_join_det_new
fieldnames = it_join_fields
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
How can i download data in excel sheet .
Hi all
My Requirement : In a selection screen after giving a VBELN,It will show all the related data from VBRP table through alv . There are a customize icon ,after clicking the icon it will download all fetched data .
Can any one help me .how can i download the fetched data through excel ?
Regards
Rajesh .Hi Rajesh,
I understood your requirement as from ALV you want to download the data to an Excel sheet.
In standard ALVs, you need to do this
In other cases like Z programs etc, often Icon is provided (as you said) like this
You need to select Local File option here as shown below
In both case you will get this pop-up
Now when you continue you will get SAVE dialog-box, where you can give a name to your excel file and Save.
Hope this is your query.
Jogeswara Rao K
Maybe you are looking for
-
HP Laptop Power Cord Safety Recall and Replacemen​t
Some power cords for HP and Compaq and mini notebook computers sold from September 2010 through June 2012 may be part of voluntary recall and replacement program launched on August 26, 2014. The impacted power cords have the potential to overheat, po
-
Deadline May 27--Need to Transfer Curve 9360 to iPhone 5c
Just received new iPhone 5c via T-Mobile. Need to send in Curve 9360 trade-in before May 27. How do I transfer everything possible, including calendar, contacts, and saved emails? Thanks in advance!
-
Hi gurus, I am just trying to create Catalog Profie. Clent Requirements is foe example i am cretaing one catalog of crane . Crane as catalog profile. Now i ahve maintained all object parts for crane using qs4, similarily damage and causes. now when i
-
Hello, All I try to research and test row compression on DB2 9.7 I have one BW table with 67 M rows on our production system with DB2 9.1.7 what hold 793558 pages I create the same general table (ODSTAB) and it's copy table (ODSTAB_COMP) with COMPRE
-
App I had before is no longer available
I had a app called "Alone at war 2" from the app store, yesterday I reset my phone to factory settings and when I tried to reinstall the game it says "This item is no longer available" Not "Not available in US stores" (Or whatever) I can still view t