Download excel
output is being displayed in ALV hirarchical list and this output is to be downloaded in EXCEL for
but the format of the output is below.
Material Description Validity EAN-code Plant Description
1M00.590 GO520 Scandinavia 1/1/2008 636926017046 NL10 Moduslink
Level Material Description Qty. Material type Material group
0 1M00.590 Scandinavia 1 FERT
1 5M00.590 Outerbox Scandinavia 1 HALB NL
1 2M00.590 Component Box Sub 1 HALB CN
2 5M00.000 x20 Plastic Tray 1 HALB NL
Material Description Validity EAN-code Plant Description
1M00.510 GO520 Scan 1/1/2008 636926017046 NL10 Moduslink
Level Material Description Qty. Material type Material group
0 1M00.510 Scandinavia 1 FERT
1 5M00.510 Outerbox Scandinavia 1 HALB NL
1 2M00.510 Component 1 HALB CN
2 5M00.000 x20 Tray 1 HALB NL
Please suggest how to acheive this?
Dear Prince,
Since you might be using internal table for ALV output, same internal table you may pass to FM 'GUI_DOWNLOAD'
like below.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'C:\Documents and Settings\saptrng\Desktop\desktop\xyz.xls'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = 'X'
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 = ' '
IMPORTING
FILELENGTH =
tables
data_tab = itab
FIELDNAMES =
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.
PS : reward if useful
Regards
Talwinder
Similar Messages
-
Problem: JSP does not restore after downloading Excel.
I have a "search.jsp" with a commandButton to generate excel. "Report.jsp" opens up in a new window when i click on this button by running below mentioned javascript. I can download Excel successfully by clicking on Download Excel link in report,jsp. Problem is, once i close this new window, I am unable to perform any other action in "search.jsp" even if i do not perform download. If i click on any other button or link "search.jsp", it replaces whole jsp with the Downlaod Excel link. and nothing happens after that . i need to close the seesion and start all over again from login page. Does anyone has solution. It will be big help. Thanks.
JAVASCRIPT:
function aaaa()
mywindow =window.open('report.jsf', 'popupWindow', 'width=400,height=200,left=0,top=100,screenX=0,screenY=100');
Following is report.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://www.backbase.com/2007/jsf" prefix="bjsf" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
<h:form>
<h:commandLink actionListener="#{searchpage.export}" value="Download Excel" />
cancel
</h:form>
</f:view>
</body>
</html>
Following is export function which runs when i click on above commandlink "Download Excel":
public void export(ActionEvent event) {
try {
FacesContext context = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) context
.getExternalContext().getResponse();
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment; filename=report.xls");
ServletOutputStream servletOutputStream = response
.getOutputStream();
WritableWorkbook workbook = Workbook
.createWorkbook(servletOutputStream);
WritableSheet sheet = workbook.createSheet("First Sheet", 0);
WritableFont lfont = new WritableFont(WritableFont.ARIAL, 10);
lfont.setBoldStyle(WritableFont.BOLD);
WritableCellFormat lformat = new WritableCellFormat(lfont);
lformat.setBackground(Colour.DARK_RED2);
lformat.setBorder(Border.ALL, BorderLineStyle.THICK);
WritableFont rfont = new WritableFont(WritableFont.ARIAL, 10);
WritableCellFormat rformat = new WritableCellFormat(rfont);
rformat.setBorder(Border.ALL, BorderLineStyle.THIN);
for (int i = 0; i < this.list.size(); i++) {
HashMap h = (HashMap) this.list.get(i);
if (i == 0) {
Set s = (Set) h.keySet();
Iterator itr = s.iterator();
int j = 1;
while (itr.hasNext()) {
Label label2 = new Label(j, 1, itr.next().toString(),
lformat);
sheet.addCell(label2);
j++;
Collection c = h.values();
Iterator itr = c.iterator();
int j = 1;
while (itr.hasNext()) {
Label label2 = new Label(j, (i + 2), itr.next().toString(),
rformat);
sheet.addCell(label2);
j++;
workbook.write();
workbook.close();
context.responseComplete();
} catch (Exception e) {
e.printStackTrace();
}Try upgrading JSF. I recall a Javascript-specific bug like this in a specific webbrowser. You could try to test in different webbrowsers. The latest JSF 1.2 is currently 1.2_14 which came out just 3 weeks ago. You can get it at [http://javaserverfaces.dev.java.net].
Oh, you certainly need to invoke `FacesContext#responseComplete()` afterwards. This is really not the problem. -
ALV problems, trying to click Back button, Filtering, download (Excel)
Hi
When I try to click Back button, Filtering or download (Excel) on ALV grid this dumps appear:
Runtime Error MOVE_TO_LIT_NOTALLOWED_NODATA
Error analysis
The program tried to assign a new value to the field "<L_BOX>" even though
it is protected against changes.
The following objects are protected:
- Character or numeric literals
- Constants (CONSTANTS)
- Parameters of the category IMPORTING REFERENCE for functions
and methods
- Untyped field symbols to which a field has not yet been assigned
using ASSIGN
- TABLES parameters if the corresponding actual parameter is protected
against changes
- USING reference parameters and CHANGING parameters for FORMs if
the actual parameter for this is protected against changes
- Field symbols if the field assigned using ASSIGN or ASSIGNING
is protected against changes
- External write accesses to READ-ONLY attributes
- Key components of lines in internal tables of the type HASHED or
SORTED TABLE
SORTED TABLE.
Line SourceCde
681 * set/unset <box> of all items
682 if l_ucomm eq '&SAL' or l_ucomm eq '&ALL'.
683 if l_ucomm eq '&SAL'.
684 loop at t_outtab.
685 l_tabix = l_tabix + 1.
->>> <l_box> = ' '.
687 modify t_outtab index l_tabix.
688 endloop.
689 endif.
690 if l_ucomm eq '&ALL'.
691 loop at t_outtab.
692 l_tabix = l_tabix + 1.
693 <l_box> = 'X'.
694 modify t_outtab index l_tabix.
695 endloop.
696 endif.
What I must check on my ALV settings:
ch_alv_layout-zebra = 'X'.
ch_alv_layout-box_fieldname = 'SELE'.
ch_alv_layout-box_tabname = v_nametab.
ch_alv_layout-reprep = 'X'.
ch_alv_layout-info_fieldname = 'COLOR'. "infofield for listoutput
ch_alv_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = ch_alv_layout
it_fieldcat = ch_alv_fieldcat
it_sort = ch_alv_sortinfo
i_save = 'X'
it_events = ch_slis_event
TABLES
t_outtab = p_control
EXCEPTIONS
program_error = 1
OTHERS = 2.
Thanks in advance.ch_alv_layout-info_fieldname = 'COLOR'. "infofield for listoutput
ch_alv_layout-colwidth_optimize = 'X'.
try commenting the above values.and also check the Fieldcatlog.
Check the issue similar issue was resolve by checking catalog and layout:
[ALV Issue solution|Re: Problem when export ALV.]
Regards,
Gurpreet -
URL Link on downloaded Excel File
Hi,
I have got a requirement.
For study and analysis purpose user download data on excel file from OCOD. Struture(Contents) of downloaded excel file is same as screen.
But the problem is when user click on 'DETAIL' (which has URL link) he/she is directed to Live OCOD and asked for log in with ID and Password, even if
user is logged in OCOD.
What i want to do is.
1) Download Excel file without any URL link.
2) If 1) is not possible then do not want to have 'DETAIL' option of downloded file.
3) Method for avoiding relog into OCOD.
Thanks in Advance
YujYuj, within the application click on the Training and Support link in the upper right, then click on Add-On Applications, then click on Reports and Analysis for Excel Template. In order to take the webinar click on Browse Training, then click on Training Resources by Job, then click on All Users, then click on Using Mail Merge for Word and Reports and Analysis for Excel with Oracle CRM On Demand.
-
In SAP Webdynpro using ABAP,how to colour the downloaded excel file?
Hi all Experts'
I have downloaded the data from the webdynpro application into an excel file in the presentation server using a custom button in a layout of a view in the webdynpro component.
Now the requirement is to colour the column heading names and the downloaded excel file should show the full column length.
Could anybody help me on this how to do this two things.
Thanks in advance.Hi,
You can use this function GUI_EXEC.
Let say you want to use winzip to zip the file then what you should do like this:
use this command --> ' -min -a D:\WALCOTT.ZIP D:\MBARANG.TXT'
D:\MBARANG.TXT --> path to the file you want to Zip
D:\WALCOTT.ZIP --> result zip file
The command above is depends on the software you use to zip.
then
DATA: cmdguiexec(150).
cmdguiexec = cmd.
CALL FUNCTION 'GUI_EXEC'
EXPORTING
command = cmdguiexec.
Hope this help you.
Best Regards,
Victor. -
Download Excel file from from a second server
Hi,
In our Java based web application (jsp pages) users need to download Excel files stored on a different server (business tier) than the first application server server that hosts only the presentation tier.
For security reasons users don't access the second application server. From a technical point of view what's the best solution to answer this requirement ? The logic should be the following: the user clicks on a report name that is displayed on this browser, the request is sent to the first application server that will retrieve the report stored on a second server and will return it to the user.
Thanks a lot.it's been a while since i've done ejb stuff, but i believe you can configure an ejb to "runas" a different user. so, you would configure an ejb on the accessible server to "runas" a user who has access to the secondary server.
-
Why the ALV download Excel can't show all field title?
Dear All
I have a problem for ALV download to Excel
Example: the field title description has 11 len bits when I download Excel then the field title is u2018descriptiou2019 only 10 len bits. I found when the field value is more then 11 then can show all,if the field value less than 11 then download Excel only show 10.
The description has 40 bits.if itu2019s value less 40 then ALV CONDENSE the space .
I removed this code: GT_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.but problem is also exits.
How can I do ?
ThanksMake sure you populate below, it may help you to solve your problem.
t_fieldcatalog-col_pos = col_pos.
t_fieldcatalog-outputlen = out_len.
Rgds,
SaiRam -
While downloading excel template I am getting error in Weblogic 10.3.4
while downloading excel template I am getting error as java.lang.IllegalStateException: Cannot resize buffer - 325 bytes have already been written (Servlet 2.3, sec. 5.1)
Ankit,
You are trying to set speed 1000 on a 10g sfp.
type is 10Gbase-SR
You will need to insert a 1gig sfp and then you will be able to set the speed.
Also, I noticed that you posted first with interface 2/6 and the output you gave me was for 4/6. Are you sure you're in the right interface? -
Filename of downloaded Excel file
I frequently download Excel files from a website that seems for the most part windows centric. These excel files have an extension of .xls, I can double click them to open, but when opened they just have the file name of WORKSHEET. If I rename the file in the finder the same thing happens. If I try to open the file in numbers I get something like
<table border="1">
<!-- <tr><td colspan = "15" valign="middle" align="center">Date: 8/1/2008</td></tr>-->
<!-- <tr><td colspan = "15" valign="middle" align="center">Investor's Business Daily Æ</td></tr> -->
<tr><td colspan = "15" valign="middle" align="center">Investor's Business Daily 100</td></tr>
<tr><td colspan = "15" valign="middle" align="center">Data as of 8/1/2008 market close</td></tr>
Any idea? Now I have to open the file in excel, then do a save as, type in the file name (if I don't want WORKBOOK), then delete (or write over) the original file. What can I tell the website people?Hello ,
In my procedure i am passing id and with the help of that id , ia am fetching values from the database.
i have declared on clob type variable say v_insert where i am storing table structure(like worksheet) which i need on excel
example
v_insert := v_insert||'<tr>';
v_insert := v_insert||'<td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td><b>Column1_Value</b></td> <td>abc</td>';
v_insert := v_insert||'</tr>';then i am converting that clob into blob and storing the content into BLOB type variable say v_blob
below is the code used for downloding the blob content.
wpg_docload.download_file(v_blob);Thanks,
Jitendra -
Leading zeros in downloaded excel
Hi,
I'm facing a problem with truncated leading zeros in downloaded excel. Can anybody suggest me how to get those leading zeros in excel.
I tried Function modules XXL_FULL_API and WS_DOWNLOAD, both did not work.
Regards,
PraveenaHi Praveena,
check the following code.
data : begin of itab occurs 0,
matnr like mara-matnr,
maktx like makt-maktx,
matnr2 like mara-matnr,
end of itab.
itab-matnr = '00000011111'.
itab-maktx = 'test1'.
itab-matnr2 = '00000011112'.
append itab.
itab-matnr = '00000033333'.
itab-maktx = 'test2'.
itab-matnr2 = '00000044444'.
append itab.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME = 'D:\c.xls '
FILETYPE = 'WK1'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = itab
FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
nagaraj -
Trouble downloading excel attachments
recently I can't download excel or pdf files from my emails....it shows the attachments on the email but it won't download the files at all...I've cleared the downloads folder but still no help.
... I can't download excel or pdf files from my emails.... it shows the attachments on the email but it won't download the files at all...I've cleared the downloads folder but still no help ...
Hi,
Which email application (e.g. Outlook <version>, Outlook Express, IE, ... etc) are you using?
Cheers,
Tas Chew -
Logo is not showing on downloaded excel
Hello all,
i am downloading page in excel .
downloading is done succesfully. while opening it is giving alert message but its ok.
i have one logo on downloaded excel.for logo i have included path of that logo
like
V_CONTENT := V_CONTENT||'<td rowspan="4"><table width="100%"><tr><td width="50%" align="left">
<img src="http://www.abc.com/images/logo.gif" width="145" height="50" vspace="0" hspace="0" alt="logo"/>';here v_content is a clob variable.
when i am downloading the file from windows machine,after opening logo is there on the excel.
but logo is missing when i am doing the same from mac-operating system.
it is showing error like
The linked image cannot be displayed,The file may have been moved,renamed or deleted.verify that the link points to the correct file and location.
Apex Version : 4.1
DB Version : 10g
Gateway : EPG.
please help me on this.
Thanks,
Jitendra
Edited by: Jitendra on 16-Nov-2012 05:05Hi,
I'll try to be helpful here. First thing I do is *** believe the error message *** -- sort of. It says "The file may have been moved,renamed or deleted." Well, probably not! BUT if the file/directory path cannot be seen from the MAC, we will have the same problem. Are you working under the assumption that that directory file cannot be accessed from the MAC? On the MAC, is there a way to check on accessing the file outside of APEX?
Does it have file permissions that would allow the MAC to see it?
Regards,
Howard -
Have a pushbutton on downloaded excel sheet from SAP
Hello
Is it possible to have a Pushbutton on downloaded excel sheet from SAPCheck OLE for this.
-
Can I open and use a downloaded Excel Spreadsheet?
Can I open and use a downloaded Excel Spreadsheet?
<Re-Titled By Host>LibreOffice will not run Excel macros (read below) without some work, it's not a good solution, I also do not think that the free online version of MS Office (comes with OneDrive) has VBA, so no macros there either.
Bottom line is if you want to run macros from Excel, you'll need Excel. Preferably the Windows version (the Mac version may be better than Pages, but it's a toy in comparison to the real Excel)
Macros in Microsoft Office and LibreOffice
With a few exceptions, Microsoft Office and LibreOffice cannot run the same macro code. Microsoft Office uses VBA (Visual Basic for Applications) code, and LibreOffice uses Basic code based on the LibreOffice API (Application Program Interface) environment. Although the programming language is the same, the objects and methods are different.
The most recent versions of LibreOffice can run some Excel Visual Basic scripts if you enable this feature at LibreOffice - PreferencesTools - Options - Load/Save - VBA Properties.
If you use macros in one of the applications and want to use the same functionality in the other application, you must edit the macros. LibreOffice can load the macros that are contained within Microsoft Office files and you can then view and edit the macro code in the LibreOffice Basic IDE editor.
You can choose to preserve or delete VBA macros
Open a Microsoft Office document that contains VBA macro code. Change only the normal contents (text, cells, graphics), and do not edit the macros. Save the document as a Microsoft Office file type. Open the file in Microsoft Office, and the VBA macros will run as before.
You may delete the VBA macros from the Microsoft Office file on loading or on saving.
Choose Tools - Options - Load/Save - VBA Properties to set the VBA macro handling of LibreOffice. -
Is there an add-on for Microsoft Skydrive to download Excel sheets?
Looking for an add-on to download Excel sheets from Skydrive.
Try [https://addons.mozilla.org/en-us/firefox/addon/grooveshredder/ Groove Shredder]
-
Hi my friends
My client has a jsp web app running on Websphere. Currently, it has a function downloading data into excel sheet
Now, they want to download excel with charts on it
I know it is not so hard to do in fat clients but this case, we have a jsp webapp, and i don't know how to deal with the excel charts, templates from a jsp server
What is the best way for me to archive that requirement.
Thank you very muchBIJ001 wrote:
POI can emit binary MS Office documents, but there are also text- or xml-based alternatives like csv or the newer XML-based document formats.
In our various projects we happily use all these approaches: POI/binary, csv, xml.Thanks,
at least there is someone here who has experience with POI. I may need help when implementing it. I have background in EJB and did lot of work with servlet, jsp too but the only front ends I worked with are Swing(and AWT) and (HTML, javascript) web page, so I have not had to learn new things for long :D
Now, with the new job, I have to deal with various projects and lot and lot of things I haven't done or even known
Now, we are in design phase and I 'd like to know that whether or not we can do it
So my question should be answered "yes, we can", right?
Here is what I plan to do
In the servlet, I should generate an excel sheet with data. Then generate the charts based on the data to attach to the excel file.
Finally, dump all file into the output stream
Maybe you are looking for
-
XML in 8.1.6.
Hi I am trying to install the java classes in an 8.1.6 database (following the instructions of S. Muenches book). I managed to install the xmlparserv2 class, using the file from the JDeveloper disk. I could not however find the xmlplsql.jar file. Wha
-
I have a bunch of TV shows and more than a few movies and a bunch of music. iTunes plays the music without any problems. It will not play any of the TV shows or movies. When I click on the icon, all I get is a black screen. I'm running the latest
-
How to integrate Oracle BI Publisher via Web Services in Oracle Forms.
hi I hope you fine and happy. I think you hear about the new reporting tool (Oracle BI Publisher). Really it is a great tool. I need someone help me; How I can integrate Oracle BI Publisher via Web Services in Oracle Forms. I got the guidelines of th
-
All of a sudden Im getting this error in the oc4j deployment: Error: com.framework.business.bd.BusinessDelegateException: Error calling ServiceClassification EJB: com.framework.business.servicelocator.ServiceNotAvailableException: Could not connect t
-
Hi all, What is the wildcard character to find words....i.e;any word with any number of alphabets, starting with any alphabet between A to Z and ending with any alphabet between A to Z...i.e.,apple,zebra,america..etc... Actually I need this to distin