Download the alv report in excel
dear experts
I am creating ALV report and working fine, i want the report sould be viewed in excel format when i click the icon on AlV display
with regards.
Ajay Kumar.
Hi Ajay,
SAP has provided the user interface for downloading the data into an excel file in the tool bar there is an option for downloading into excel.
Another way is to write a code using the function module alsm_excel and then downloading into the excel,
please tell me whether this reply was useful or for further clarification revert back
Thanks in advance
Srikanth
Similar Messages
-
Download the ALV Report output into excel sheet or notepad
Hi,
how to downlaod the alv report out into excel sheet or notepad in a proper manner. program contain large number records....
Thanks in advance!!!!
Regards,
kranthi.Hi
Download a report to excel with format (border, color cell, etc)
Try this program...it may help you to change the font ..etc.
Code:
REPORT ZSIRI NO STANDARD PAGE HEADING.
this report demonstrates how to send some ABAP data to an
EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
handles for OLE objects
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
TABLES: SPFLI.
DATA H TYPE I.
table of flights
DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
*& Event START-OF-SELECTION
START-OF-SELECTION.
read flights
SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
display header
ULINE (61).
WRITE: / SY-VLINE NO-GAP,
(3) 'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(4) 'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(8) 'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
ULINE /(61).
display flights
LOOP AT IT_SPFLI.
WRITE: / SY-VLINE NO-GAP,
IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
ENDLOOP.
ULINE /(61).
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-007
EXCEPTIONS
OTHERS = 1.
start Excel
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-008
EXCEPTIONS
OTHERS = 1.
get list of workbooks, initially empty
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP.
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - start
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP EXPORTING #1 = 2.
PERFORM ERR_HDL.
tell user what is going on
SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - end
disconnect from Excel
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'C:\SKV.XLS'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
FORM FILL_CELL *
sets cell at coordinates i,j to value val boldtype bold *
FORM FILL_CELL USING I J BOLD VAL.
CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
PERFORM ERR_HDL.
SET PROPERTY OF H_ZL 'Value' = VAL .
PERFORM ERR_HDL.
GET PROPERTY OF H_ZL 'Font' = H_F.
PERFORM ERR_HDL.
SET PROPERTY OF H_F 'Bold' = BOLD .
PERFORM ERR_HDL.
ENDFORM.
*& Form ERR_HDL
outputs OLE error if any *
--> p1 text
<-- p2 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
Please note that this example maybe slow at filling the excel table
(perhaps four fields per second on a 900 MHz machine - almost 30 seconds
for a short example).
To get the data on properties and methods - there is a bit of smoke and mirrors
going on here; they are EXCEL properties and methods, not sap ones - so you need
to look at excel help to determine how a particular function is structured. then
build the block in sap, as shown in the example.
If you only want to transfer the data to Excel like when you transfer the data from
ALV to Excel simply use the Function Modules:
XXL_SIMPLE_API
If you want more modifications when you transfer it to Excel use:
XXL_FULL_API -
Problem while downloading the alv output to excel file.
Hii,
While downloading the alv output to an excel file i am facing a problem. Either the output comes as 1.23456E+11 or the values get cut .
Cant put in txt file as the users require to calculate directy and i have even tried to increase the output length .But both doesnt help.
So what are the other ways to do so.
Edited by: mansi_v27 on Mar 24, 2010 12:35 PMHi,
Welcome to SCN!!!.
Please go through the forum rules. This has been discussed many times. You can search in the forum for this.
Infact there is no problem. Just expand that excel cell. You can see the full value. This is standard excel property.
Thanks,
Vinod. -
Regarding download of the ALV report to excel
Hi experts,
I have an ALV report which took long time to extract records from various table. So while there is some restriction the report can be executed well in foreground. And the report can be extracted well to excel sheet. But while there is hudge records, i have to execute the report in backgroung. And then from spool i generally prefers to download the report to excel.
There is a field UOM where it contains value ' " ' for some records. And also there may be possiblity that other fields can also contain the same.
Now my problem is: while download to excel... When ever there is a value ' " ' from this point to the next value ' " '. It is treating as one record. and keep that in a same position in the excel sheet.
But i want to keep all the values in there respective fields. Can you please how can i do that? Please give me some solution...
regards,
charles.Actually now I think there is another way to do this, storing file on application server can create problems as sometimes the users don't have directory write access or things like that.
Instead you should export your data to a memory or database cluster and import it back using abother program.
The proposed changes would be
1: At the point you are calling your alv grid function, check if the sy-batch is 'X' for background job, if yes than export to database table INDX or you can create your own. suppose your data is in internal table ITAB than in case of background job, you will do
data: keyf like indx-srtfd.
*We just assign username, date time to this
concatenate sy-uname sy-datum sy-uzeit into keyf.
EXPORT itab TO DATABASE indx(ZZ) ID keyf.
check for subrc if export is successfull.
Now you have stored your itab in database for later processing. remember to have keyf. In case of background job you can have it write in the output so from spool output you can check what was the keyf to use.
You have to write another program to import itab from database and download it or display it.....
This program will have keyf as input parameter and you must define ITAB same as the orignal program.
parameters: p_keyf like like indx-srtfd.
import itab from database indx(ZZ) id keyf.
*Now you have itab. do whatever you want with it. download it using GUI_DOWNLOAD function or display it in an ALV grid.......
Hope you got the overall idea. -
Problem while downloading a ALV report to excel
Hi experts,
I have an ALV report which took long time to extract records from various table. So while there is some restriction the report can be executed well in foreground. And the report can be extracted well to excel sheet. But while there is hudge records, i have to execute the report in backgroung. And then from spool i generally prefers to download the report to excel.
There is a field UOM where it contains value ' " ' for some records. And also there may be possiblity that other fields can also contain the same.
Now my problem is: while download to excel... When ever there is a value ' " ' from this point to the next value ' " '. It is treating as one record. and keep that in a same position in the excel sheet.
But i want to keep all the values in there respective fields. Can you please how can i do that? Please give me some solution...
regards,
charles.If anybody have any solution please send me....
-
Downloading the ALV layout to Excel sheet
Displaying ALV using OOPS concept.
Dynamic internal table is passed in the
CALL METHOD gcl_grid->set_table_for_first_display
For downloading into Excel sheet used EXPORT->LOCAL FILE->Spread sheet
<b>The TEXT.XLS file is not looking like as it is there in the layout.</b>
gv_layout-cwidth_opt = 'X'.
gv_layout-sel_mode = 'A'.
CALL METHOD gcl_grid->set_table_for_first_display
EXPORTING
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_CONSISTENCY_CHECK =
i_structure_name =
IS_VARIANT =
i_save = 'A'
i_default = 'X'
is_layout = gv_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = <tabx>
it_fieldcatalog = gt_fieldcatalog
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
What will be the problem? Pls. resolve this.Hi Sreedevi,
1) Once you have alv report displayed in the screen.
2) Click button 'View' ( next to print button) on application toolbar
3) Select Excel in Place
4) This will download the same format as of Report
I hope your ALV have all the Standard functions in Toolbar. If not copy the status from and get the function as mentioned above.
Program - SAPLSALV
Status - STANDARD
Reward points if this Helps.
Manish -
Regarding downloading the ALV tree to excel
I have prepared a report in which the ouput will be in ALV tree format. Now i want to download the tree to excel file. If anyone can help me out i'll be very thankful.
Regards,
RohitashHi
Use the FM - ALV_XXL_CALL. here is the sample -
REPORT ZSKC_ALV_XXL.
TYPE-POOLS : KKBLO.
DATA : ITAB LIKE T100 OCCURS 0,
T_FCAT_LVC TYPE LVC_S_FCAT OCCURS 0 WITH HEADER LINE,
T_FCAT_KKB TYPE KKBLO_T_FIELDCAT.
START-OF-SELECTION.
Get data.
SELECT * UP TO 20 ROWS
FROM T100
INTO TABLE ITAB
WHERE SPRSL = SY-LANGU.
CHECK SY-SUBRC EQ 0.
Create the field catalog.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'T100'
CHANGING
CT_FIELDCAT = T_FCAT_LVC[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CHECK SY-SUBRC EQ 0.
make sure you pass the correct internal table name in the field catalog.
t_fcat_lvC-tabname = 'ITAB'.
MODIFY T_FCAT_LVC TRANSPORTING TABNAME WHERE TABNAME NE SPACE.
Transfer to KKBLO format.
CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
EXPORTING
IT_FIELDCAT_LVC = T_FCAT_LVC[]
IMPORTING
ET_FIELDCAT_KKBLO = T_FCAT_KKB
EXCEPTIONS
IT_DATA_MISSING = 1
IT_FIELDCAT_LVC_MISSING = 2
OTHERS = 3.
CHECK SY-SUBRC EQ 0.
Call XXL.
CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
I_TABNAME = 'ITAB'
IT_FIELDCAT = T_FCAT_KKB
TABLES
IT_OUTTAB = ITAB[]
EXCEPTIONS
FATAL_ERROR = 1
NO_DISPLAY_POSSIBLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
ENDIF. -
How can i download dynamic alv report into excel ?
when i create dynamic alv report and try to download it
to my pc ( to excel file ) the data is not set in the
write position , also i get message in the excel
"Dynamic List Display " .
how can i set the data like the alv display ?ALV has standard download functionality to Excel. Aren't you able to use this functionality? Have you written your own custom code for DOWNLOAD?
-
Issue while downloading the alv report output in spreadsheet format .
Hi,
I have a report output, whenever I try to download it in the spreadsheet format to my desktop,
I get the following issue:
Say the correct material number is 10833340001218999 or 10030000063207001
(This appears in the report output)
But in the excel file the number is displayed as 10833340001218900 and 10030000063207000.
Please help.
Regards,
Sucharita.Hi Sucharita,
The reason for your problem could be that in excel 2007, characters more that 15 are replaced with 0.
Or you can try downloading the data using FM 'GUI_DOWNLOAD' , if currently you are using stadard SAP functionality of data downloading.
Best Regards,
Vishal. -
Download alv report in excel format in Linux
Hi All,
I am working on SAP GUI for Java in Linux PC. I have installed
Open Office.
After executing an alv report there is no spreadsheet option
to download the report in excel format .
Also, when doing Save as Local File -> Spreadsheet ,
the report is not downloaded in proper format.
So, how to download the alv reports in excel format ?Hi Vinod ,
Save as Local File -> Spreadsheet
It will ask for Directory and file name with .xls format . Give proper name e.g. test.xls and save, and after saving file right click on the file and click on Open with "OpenOffice.org calc".
It will definetly work.
Abhijeet -
Problem in downloading ALV report to Excel
hi All,
i am facing the problem when i am trying to download the ALV report to Excel format i should have the option to save as the Excel file from the dropdown where as instead of it i am getting the option to save as XML file.
is it something related to settings in SAP or is it done through programatically.
thanks,Anyways is this happening for every one in your team or just for one. If the latter, looks like the user has selected the download in XML format & checked the "remember these settings" checkbox
You can refer to this link on how to change the default settings: [http://home4sap.com/Blog/2010/03/ecc5-0-alv-default-file-format-when-extracting-files-to-excel/|http://home4sap.com/Blog/2010/03/ecc5-0-alv-default-file-format-when-extracting-files-to-excel/]
You can also check this SAP offers the possibility to make from transaction FAGLB03 a download
Edited by: Suhas Saha on Apr 13, 2010 4:40 PM -
Download alv report to excel in linux
Hi All,
I am working on SAP GUI for Java in Linux PC. I have installed
Open Office.
After executing an alv report there is no spreadsheet option
to download the report in excel format .
Also, when doing Save as Local File -> Spreadsheet ,
the report is not downloaded in proper format.
So, how to download the alv reports in excel format ?
Edited by: Vinod Iyer on Jan 8, 2008 11:51 AMThe problem of course is that you can't actually call up EXCEL on a Linux machine so such XXL functions as call function 'ALV_XXL_CALL' will not work.
I don't think SAP has OPEN OFFICE integration -- and even if you use EXCEL via the Linux Cross Over Office it is unlikely to work.
You might need to fiddle around with the internal file format yourself before saving it as a local file.
For EXCEL 2007 you actually have a better chance since if you save in TRUE EXCEL 2007 format the data is saved in a type of XML file.
You can read about the EXCEL 2007 new file formats on the M$ site. Note however that you will need to download the EXCEL 2007 file viwer to read the file with earlier versions of EXCEL.
(You can use EXCEL 2007 in "compatability" mode but using an XML file IMO seems a better option).
If you use a lot of EXCEL functionality probably the best option is to install Windows as a VM on your linux machine (VMWARE/PARALLELS/VMBOX etc) and then run the standard SAPGUI from the Windows VM.
Probably not the answer you want but it's the best I can do.
Cheers
jimbo -
Download ALV report to excel sheet
halo fellow SAPiens,
i want to download my alv report into excel sheet...........for tht i used UGI_DOWNLOAD........here if i use the file type as 'ASC' all the leading zeros of numeric values are removed and date format is "yyyy/mm/dd".......
i need the leading zeros and date format in "dd/mmyyy"
when i use file type 'DBF' i get the leading zeros but my date is replaced by '#####.............wht shld i do...........To get the leading zeros to come, append an apostrophe to the start of each field that has the leading zeros as shown
loop at itab.
concatenate '''' itab-field1 into itab-field1.
modify itab.
endloop.
note that
1. This sometimes doesnt show correctly in excel and you may have to double click on the cell to prevent the apostrophe from displaying in the sheet
2. You field needs to have an extra character to add the apostrophe -
Downloading ALV report in excel and csv format
1.I have generated a report in ALV.
Now, I want a button 'generate' on my alv tooldbar.
How to do that?
2.Now clicking on that generate button will show a popup window containing the title 'Save list in file..'
And the window will contain two radio buttons to download the report in either in excel or in csv file format.
i. Spreadsheet(.xls)
ii.Spreadsheet(.csv)
How to get the popup window containing two radio buttons and having the options for downloading the alv report in the above file formats.
Kindly guide.@chandrasekhar:
Thanks for your response. I'll try with the export button but also willing to know how to create button on toolbar.And by clicking on that button a popup box will come having two radio buttons asking to download the report either in .xls or in .csv format. I am looking for the subroutines for that.
Thanks.
Message was edited by:
cinthia nazneen -
Hi Guys,
Im facing a peculiar problem.
When I try to download an ALV report in excel format using (list ->export -> local file-> soread sheet )Im not able to download complete set of records.
Same is happening with ws_download, even though the internal table contains all the record; the number of downloaded records are not same.
Any one faced same problem. Pls. help me out.
Regards,
Sumitlooks strange!!!!!!!!!!!
change these in excel sheet and check out if it works
Change the macro settngs in your excel sheet and checkout if it works
Open empty excel sheet
In menu Tools>Macros>Security , change the radiobutton to medium
And also
In the Same popup , goto the second tab Trusted Publishers and check the checkbox Trust access to visual basic Project
Maybe you are looking for
-
Movimentos de Mercadorias em SD
Gurus, Preciso de uma ajuda para concluir um cenário de Exportação. As Vendas de Exportação não podem executar GI no momento da emissão da Nota Fiscal então há uma interface com um Software complementar que efetuará a GI definitiva através da MB11. A
-
For some time now I have been unable to install applications onto my computer[Mac Pro/OS X 10.4]. I've checked the system with the disk utility without any positive result[system did not need repair]. System Updater seems to work when something comes
-
Why does iPod touch lags horribly when connected and disconnected from USB? I only have 0.5 GB usage out of 6.4 GB. It also freezesfrom time to time when turning iPod back on, loading an application, loading settings, etc. Many lag going on when doin
-
Syncing iPhoto on iPad (iOS) with iPhoto on Mac. How to?
I am using iPhoto on Mac as well as iPhoto on iPad. Being a heavy (pro) user of iPhoto on Mac, I always organise by Keywords and Stars. When doing on Mac then syncing to iPad, it is easy. However if I were to go overseas and just bring my iPad with m
-
I am upgrading it to Enterprise Portal 6.0 Service Pack 22.
Hi, I need to upgrade Enterprise Portal 6.0 Service Pack 09. I am upgrading it to Enterprise Portal 6.0 Service Pack 22. I am writting the download files names: 1> WebAS 6.40 SP22(Part 2/4): SAPInst Control File for Oracl--> CTRLORA22_0-20000118.SAR.