Facing problem while downloading ALV grid Output into Excel
Hi Guys,
I am facing problem while downloading ALV grid Output into Excel.
It is downloading into excel, but all character columns first and next all quantity columns it is displaying. But I need columns order as it is in the grid.
If I take all columns as characters it works fine. But it will be problem for calculating total, subtotals of quantity columns
Can someone help me regarding this
thanks for your help
Hi,
Open up Excel on your desktop. Goto Tools > Macro > Security.
Make sure that your security is set to Medium (or less). SAP uses OLE automation to run the Excel instance and in Office 2003 (for example), Microsoft has increased their default security setting to High. With the High setting, the output to Excel fails.
Was this your problem? Don't forget those points, either.
check with this wetther it is solved or not.
Regards,
sana.
Similar Messages
-
Problem while downloading ALV GRID Output to Local Spreadsheet(Excel) File.
Hi,
I am displaying output in ALV GRID. While downloading the output to Excel file using "Local File" option provided by ALV.
But while downloading the columns and their respective values are coming in single column vertially of excel file instead of horizontal.
e.g. Grid output is as follows.
F1 F2
V1 V2
(F represents Field Title, and V represent Value)
Downloaded Excel File content:-
F1
F2
V1
V2
Please help.Hi ,
Please use below FM :
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\Documents and Settings\akshayr2403\Desktop\docs\rep.xls'
FILETYPE = 'WK1'
WRITE_FIELD_SEPARATOR = 'X'
tables
data_tab = it_vbak
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 = 8
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.
Also, if your problem still persist, please refer SAP's demo code on ALV "BCALV_FULLSCREEN_DEMO".
There are many sample codes available, what you need to do is just go to SE38 and put BCALV* and do F4.
I hope this will help you.
Regards,
Rahul Mahajan -
Problem in downloading ALv Grid output
Hi Friends,
I've made an ALV report using the FM: REUSE_ALV_GRID_DISPLAY. Now when I try to download the output in excel using the path:LIST->EXPORT->EXCELSHEET, the 'excelsheet' option is showing as disabled. This is happening only for this report, while I'm successfully ablw to do this for other ALV grid reports. I'm on ECC6.0 & trying to download the output in XXL format.Kindly help me as what exactly needs to looked into.
Thanks:
Gauravhi,
Think that you does n't have authorization for that (auth group "J_1IDNLD").
You can try to do with another user which is ahving authorisation.
Get authorization for above grp. Hope it will helps you. Thanks!
Kishore -
How to download alv grid output(with field catalog) into excel file format
Hi all,
How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
Please help.
Regards,
Satya.Hi,
On list where alv is displayed, select export icon( green color -> ),select spread sheet.
This will display records in Excel sheet. -
hi,
i have two problems in displaying ALV grid output Using Oops.
1) How to modify the fieldcatalog after we getting a field catalog using general FM.
2) initialy it is displaying 13 fields but there are 63 fields .
eventhough we chage the layout to 63 fields it is displaying only 13 fields , these 13 fields may be different based on our selection but count of displayed fileds are same . how can display 63 fields at a time .Hi,
You can chnage using below code:
loop at gt_fieldcat.
if <gt_fieldcat-field_name> = 'FIELDNAME'.
endif.
modify gt_fieldcat.
clear gt_fieldcat.
endloop.
Make sure that all the field should not have no_out = 'X' and tech = 'X'.
Thanks,
Sriram Ponna. -
Download alv report output to excel format with out header line
Hi experts,
i want to download a alv report output into excel formatt with out the header line but it has to download including field description. as this output will fed into another transaction, the downloaded excel file should be with out header line.
fro eg:
Report : Zabc ABAP Development Page : 1
Run Date : 12/14/06 System: UD400
Run Time : 08:45:37
this header details should not be downloaded into the excel file.
could somebody help me please.
thanks
deepuhi jayanti,
thanks for your response.
i have delclared all the field types as character but still it is not downloading and it 's sy-subrc is 4... the code is as below.
*field names
lt_fieldnames-value = 'Material Number'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Plant'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Material Group'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Material Description'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'UOM'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Price Unit'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Material Type'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'X-Plant Status'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Valuation Class'.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_avmng.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_avntp.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Latest PO Qty'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Latest PO Cost'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'PO Creation Date'.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_fcaqt.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Prev. Yr. Std. Cost'.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_stcst.
APPEND lt_fieldnames.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = 'XLSHEET'
CREATE_PIVOT = 0
DATA_SHEET_NAME = ' '
PIVOT_SHEET_NAME = ' '
PASSWORD = ' '
PASSWORD_OPTION = 0
TABLES
PIVOT_FIELD_TAB =
data_tab = t_output1
fieldnames = lt_fieldnames
EXCEPTIONS
file_not_exist = 1
filename_expected = 2
communication_error = 3
ole_object_method_error = 4
ole_object_property_error = 5
invalid_pivot_fields = 6
download_problem = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE e001 WITH 'Data could not be downloaded'.
ENDIF.
ENDFORM. " z_dwn_xl
thanks
deepu -
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 -
Error while downloading ALV grid o/p list into local file
Hello friends,
I have developed an ALV report and desplaying it using
'REUSE_ALV_GRID_DISPLAY, function module .While downloading the output list into excel format I am geeting an error "The current statement only supports character-type data objects.
Error Analysis-
In statement
"STRLEN( obj )..."
the argument "obj" can only take a character-type data object.
In this case, the operand "obj" has the non-character type "P".
I have set the import parameter i_save values as 'A'
But still not able to download and facing the same error.
Please help me out ....
Thanking you....
Regards,
Rajesh Akarte
Message was edited by:
Rajesh AkarteHi,
following is the dump code..Is there any problem due to date and currency fields..?
Error in ABAP application program.
The current ABAP program "SAPLKKBL " had to be terminated because one of the
statements could not be executed.
038350 endif.
038360 gs_out-hlplen = strlen( gs_out-hlpchar ).
038370 elseif gs_fc-tech_form = 11. "INS TECH
038380 * Min. Ausgabelänge für ein Datum ist immer 8
038390 if gs_fc-datatype = 'DATS'. "INS TECH
038400 gs_out-hlplen = 8. "INS TECH
038410 * Min. Ausgabelänge für eine Uhrzeit ist immer 6
038420 elseif gs_fc-datatype = 'TIMS'. "INS TECH
038430 gs_out-hlplen = 6. "INS TECH
038440 endif. "INS TECH
038450 elseif gs_fc-tech_form = 1 or gs_fc-tech_form = 90.
038460 * Überführung int. in ext. Format via Konvertierungsexit
038470 if not gs_fc-convexit is initial or "INS TECH
038480 not gs_fc-inttype ca 'CN'.
038490 * elseif not gs_fc-convexit is initial. "DEL TECH11
038500 write Y9CK034230 -
Printing Selection-Screen while printing ALV Grid output display
Hi,
I have a requirement wherein I want to print the Selection Screen also while printing the output in simple ALV grid Display.
Currently when I print the ALV output report, only the header and the Body of the ALV is getting printed. But the requirement is that I also want to print Selection screen along with this.
If anyone has faced a similar situation, plz let me know what needs to be done in order to print the selection screen also while printing the ALV report output.
Rgds,
NitinHi,
You can use given function module to print your
selection screen
RS_REFRESH_FROM_SELECTOPTIONS
>This will get Current contents of selection screen
RS_LIST_SELECTION_TABLE
>This will Generates list according to values in selection table(RSPARAMS)
Sample
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = p_repid
TABLES
selection_table = it_int_tab
EXCEPTIONS
not_found = 1
no_report = 2
OTHERS = 3.
IF sy-subrc EQ 0.
WRITE:1 'Selection Criteria'(i19),
/1 sy-uline(18),
/1 'Variant Name'(i21),
23 sy-slset.
*-- This function module lists the Selection Screen contents
CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
EXPORTING
report = p_repid
seltext = 'X'
newpage = space
TABLES
sel_tab = it_int_tab
EXCEPTIONS
sel_tab_empty = 1
OTHERS = 2.
Mark all helpful answers -
Download the grid output to excel sheet
Hi Friends,
i have generated an ALV GRID report, in that its showing 800+ records, but when i download that to excel sheet 25 odd records are missing in the between,
i have downloaded through local file -
> to spreadsheet.
Can you please tell me the error.
Regards
Kumar Mhi kumar,
have generated an ALV GRID report, in that its showing 800+ records, but when i download that to excel sheet 25 odd records are missing in the between,
i have downloaded through local file -
> to spreadsheet.
Can you please tell me the error.
how u solved this problem same problem i am also getting plz tell me the solution.
Thanks & Regards,
Ravi. -
Hi,
I am facing a issue like when i am selecting columns of grid output and pressing microsoft excel button ,it is opening a blank excel sheet but it is not showing any data in excel sheet ,pls tell how i can get data in that excel sheet ,what else code i have to write.
sagGud,
Open up Excel on your desktop. Goto Tools > Macro > Security.
Make sure that your security is set to Medium (or less). SAP uses OLE automation to run the Excel instance and in Office 2003 (for example), Microsoft has increased their default security setting to High. With the High setting, the output to Excel fails.
Was this your problem? Don't forget those points, either. -
Exporting ALV Grid output to Excel sheet
Hi All,
How can i export the output displayed using Grid to an Excel sheet. I tried with default option from list->export->excel sheet/local file but i am not getting complete data and the data which i am getting also notin proper format. Please help me in this regard.
Best Regards,
SunilCheck out the ALV grid toolbar for export options.
Regards
Raja -
Problem while exporting ALV column header to excel sheet.
Hi,
I am able to export an ALV grid details to an excel sheet. But the ALV column headers when exported to excel sheet are getting truncated.
For eg: if my column header in ALV grid is displayed as 'Material' then the column header in excel sheet is 'Mater' only. Remaining portion is getting truncated.
How can I view the entire column header text?
Kindly assist.
Thanks.I have the same problem with you, when user export to excel. I fixed it by using
w_layo-colwidth_optimize = 'X'. <<<<<<<<<<<<This
perform generate_fcat_reftab
using 'PRUEFLOS' 'T_INPUT' '' '' 'Inspection Lot' 0.
form generate_fcat_reftab using p_fieldname
p_tabname
p_ref_tabname
p_ref_fieldname
p_output_text
p_output_lenght.
clear w_fcat.
w_fcat-fieldname = p_fieldname.
w_fcat-tabname = p_tabname.
w_fcat-ref_fieldname = p_ref_fieldname.
w_fcat-ref_tabname = p_ref_tabname.
w_fcat-seltext_s = p_output_text.
w_fcat-seltext_m = p_output_text.
w_fcat-seltext_l = p_output_text.
w_fcat-outputlen = p_output_lenght.
w_fcat-ddictxt = 'L'. <<<<<<<<<<<<<<<<<<This
append w_fcat to t_fcat.
endform. -
ALV Grid output to Excel Spreadsheet
I have one that is hopefully easy for you guys and when I search on the forum nothing comes up.
Maybe I am searching wrong.
When you have a program that outputs to an ALV grid, there is a button you can output to a file.
Like an excel document. Icon is a document with an x on it.
First time you run it, it will give you the option of excel, star office, or all available formats.
There is also a button at the bottom that says Always Use Selected Format. User
wants to change this, but once the option is gone, you cannot undo it.
How do I basically deactivate the button to not always use the selected format???
Any suggestions would be terrific.
Thanks for your help.
SteveSteve,
Try running report SALV_BS_ADMIN_MAINTAIN as indicated in [Note 1080608|https://service.sap.com/sap/support/notes/1080608].
I found this Note with the following search string: "Always Use Selected Format ALV Excel". You may also want to consider doing a search on the report name "SALV_BS_ADMIN_MAINTAIN" for further information.
Also check [Note 1157927|https://service.sap.com/sap/support/notes/1157927] "Export Excel: Reset export parameter from ALV list."
Best Regards,
Jamie
Edited by: James Gaddis on Nov 19, 2008 2:47 PM - Added another Note reference -
Formatting problem when downloading classical report output to excel sheet.
Dear Experts,
My classical report o/p looks like:
SI Name ID
1 xyz 11
2 abc 22
3 eet 33
4 jnc 44
When I download the same to a excel sheet from List->Save->file->Spreadsheet and save it.
The formatting looks like this:
SI Name ID
1 xyz 11
2 abc 22
3 eet 33
4 inc 44
That is the heading and column entries are in different columns.
There is no GUI_Download used.
Kindly help what may be the issue.Hi,
In the report output the formatting looks fine. It is exactly below the heading. But only when I save it to excel, this alignment issue is coming. Even the columns after this column are are properly aligned and there is no issue at all. Only this column in the middle has issue.
Maybe you are looking for
-
F110 - Need to take only the down payments
Hi, We want to consider in F110 only the down payment request lines to be paid. We have configured the special gl in the "All Company Code" data of F110. System is still taking the normal invoices also. How to control it? Regds, Nand
-
ISupplier Portal-Register Supplier User
Hi All After i Register Supplier User i get Confirmation that the password was generated and emailed to the supplier user but the Supplier user not receipt any e-mail . Does anyone know what workflow sends to Supplier that information . or what i can
-
Cannot see any text or fields. The web page behind it shows. The Site/Site Management dialog box is transparent. see screenshot: http://www.mid-americaclutch.com/transparent_DW_dialog_Box.jpg
-
Timestamp and dates prior to 1901
Hi, I'm using Weblogic 7.0, CMP 2.0 and Oracle 8.1.7 as client/server. There are a table in Oracle in which one of the primary keys is a DATE column. That column can include dates/hours prior to 1901. But when I use a CMP with java.sql.Timestamp clas
-
Installing cf 8 on iis with cfmail and sql 05
Hello everyone, I just purchased coldfusion 8 and have few installation questions: 1) what iis options need to be installed prior to installing coldfusion? (what are the minimum options needs to be installed with iis) 2) do i need to have a mail serv