Download Excel including header

Dear Experts,
                  I am using FM GUI_Download. is working fine. But Body of the records will be downloaded.HEADER  Data is not downloaded in the excel file.
for eg.
MATNR    MATKL  --->DO NOT DOWNLOADED
01255        test       --->Downloaded.
45445        hi          -->Downloaded.
NOTEL:   FM GUI_DOWNLOAD (HEADER one field available) How to use it?
ASP.
Warm Regards,
raj.a

Hello Raj,
Use two GUI_DOWNLOAD FM.
First you create Header and put in one internal table.that is it_header.
second, create internal table for your data that is it_data
now first call GUI_DOWNLOAD FM like below for passing your header.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
            BIN_FILESIZE                    =
              FILENAME                        = it_header
            FILETYPE                        = 'ASC'
            APPEND                          = ' '
            WRITE_FIELD_SEPARATOR           = ' '
          IMPORTING
            FILELENGTH                      =
            TABLES
              DATA_TAB                        = it_final
second call again for data
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
            BIN_FILESIZE                    =
              FILENAME                        = file_name
            FILETYPE                        = 'ASC'
             APPEND                          = ' X'                " use this to append your header
            WRITE_FIELD_SEPARATOR           = ' '
          IMPORTING
            FILELENGTH                      =
            TABLES
              DATA_TAB                        = it_final
Have a Nice Day,
Regards,
Sujeet

Similar Messages

  • Download to Excel with Header but one field data is repeating

    Hi All,
    I'm downloading to Excel with Header. But One field is repeating and another is not. This is happening only when I use   'CONCATENATE ' . With Out this key usage data download to excel is correct. But   CONCATENATE is required as constant need to add before the one field.
    My coding is as below.
    DATA: BEGIN OF IT_FINAL OCCURS 0,
          P1(10) TYPE C,
          SI(19) type c, 
            END OF IT_FINAL.
    DATA : BEGIN OF IT_HEADER OCCURS 0,
    TITLE(100) TYPE C,
    END OF IT_HEADER,WA_HEADER LIKE IT_HEADER.
    loop at it_final.
      CONCATENATE '894412' it_final-SI INTO IT_FINAL.
    modify it_final.
    endloop.
    CLEAR:WA_HEADER.
      WA_HEADER-TITLE = 'Mat No'.
      APPEND WA_HEADER TO IT_HEADER.
      CLEAR:WA_HEADER.
      WA_HEADER-TITLE = 'Serial'.
      APPEND WA_HEADER TO IT_HEADER.
    CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          FILE_NAME  = P_FILE " path offile where u need to download
        TABLES
          DATA_TAB   = IT_FINAL
          FIELDNAMES = IT_HEADER.
    CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          FILE_NAME  = P_FILE " path offile where u need to download
        TABLES
          DATA_TAB   = IT_FINAL
          FIELDNAMES = IT_HEADER.
    Excel OUT PUT:
    Mat No            Serial
    11Z52321     8944126000
    11Z52394     8944126000
    11Z52395     8944126000
    Thank You,
    Pranitha

    hi,
    it would have been better if u hve opt for creating workarea for ur internal table.
    Try to use "clear it_final" after
    CONCATENATE '894412' it_final-SI INTO IT_FINAL.
    n also change the modify statement :
    modify it_final transporting SI .
    hope this will surely help you
    Regards,
    Punit
    Edited by: punit raval on Aug 26, 2011 2:55 PM

  • 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.

  • 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.

  • 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:05

    Hi,
    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

  • How can I change excel column header using Labile.

    Dear Experts,
                          How can i change excel column header using LabVIEW.
    Thanks for any and all help!
    M.S.Sivaraj.
    Sivaraj M.S
    CLD

    As I said in my previous post, column headers in Excel are merely row 1 cells. May be I missing something here, so please be more explicit with your question.
    I guess you are using the Excel Report tools, and you want to modify an existing sheet. From my limited experience with the Excel Report tools, it is not possible to open an existing woorkbook (except as template...), so the answer to your question should be "Forget it"...
    The work around is to use the example I pointed for you before, and either to write the whole new colum headers as a string array, starting in A1, or to write a single string to a given cell in row 1.
    Hope this helps 
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • How to include header files from different directories?

    Hi,
    Sorry for the newb question, but I can't figure this out. I'm trying to compile a simple piece of code (C++) that uses header files in a directory different from the Project directory; header files are in /opt/csw/postgresql/include/pqxx. I've tried a few different things, adding that directory to the include directives under Resource Files, add existing files from a folder, etc etc. Whenever I try to build, dmake bails with status -1. I can't seem to get this working, can someone explain how to use header files from different directories?
    Thanks,
    SlowToady

    Header files are usually specified relative to a base directory. If the base directory is not a system directory -- /usr/include or the compiler installation directory -- add a command-line directive
    -I path/to/base/dirfor each such directory.
    The path can be absolute, such as
    -i /opt/csw/postgresql/includeor relative, such as
    -I ../../my/includeIn your source code, specify the header file relative to the base directory, and be sure to use quotes, not angle brackets. Example:
    #include "header.h"  // right
    #include <header.h>  // wrongThe angle brackets are used for system headers, like <iostream> or <stdlib.h>.
    The rules above are common to all compilers on Unix and Linux, and generally to all C and C++ compilers.
    For more details, read about the -I option in the C++ Users Guide. You can find the guide by pointing your browser to the "docs" directory in the compiler installation, or go here:
    http://docs.sun.com/app/docs/doc/819-5267
    All command-line options are described in Appendix A.

  • Exporting ALV to excel(including row colors)

    Hai All,
        I have an ALV which contains column color.I wnt to export to excel including the colors .Is it possible???
    If yes, kindly let me know how to do that.
    Thanks & Regards,
    Kiran I

    hi
    try these links
    http://help.sap.com/saphelp_erp2005/helpdata/en/e3/41a138c4397a42e10000009b38f842/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/7d/fe9f638af411d3805e00c04f99fbf0/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/6f/31dfd4ac4ed84189a25d8e01f14af3/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/9f/53065cb77a364aa025a12a0af37c6e/frameset.htm
    regards
    Arun
    Message was edited by: arun a v

  • 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
    Yuj

    Yuj, 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.

  • 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.

  • "Include Header Row in Subsequent Pages" is not working for table

    Hi,
    I'm using version 8.1.2.3337.1.509884.
    The pagnation feature "Include Header Row in Subsequent Pages" is not working for any table in my design. ( the check-box can not be checked no matter how many times I clicking it)
    I put such table already in a flow bodypage.
    Any similar issue reported?
    Any suggestions?
    Thanks.
    -Vicky

    Hi Raghu,
    Appologies that I uploaded a wrong version of xdp file yesterday.
    Here is the correct one.
    https://acrobat.com/#d=jr0XffvBZWXd0cVhL0OQ3A
    I totally understand that I have to check the checkbox "Include Header Row in Subsequent Pages".
    My problem is that, although I can see that checkbox, and it's not grey-out, I can not tick it. See below screenshot, with the red-cycle mark.
    You can try with above file.
    Just wondering why such weird behavior happened.
    -Vicky

  • 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 ?
    Thanks

    Make 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

Maybe you are looking for

  • Location of the upload files.

    hi SAP Expert, currently i just finished installed my SAP Easy DMS to my laptop and connect to my IDES EHP4 Server, i haven't install any content server, but i managed to upload my doc file to the SAP Easy DMS. my question is where can i find the phy

  • How to redirect CELLCLI output to text file

    Hi, I would like to redicrect the output of the cellcli command to a text file . For example , how to redirect the output of this command to a text file on /tmp CellCLI> list metrichistory where objectType = 'CELL' - and name = 'CL_TEMP'Thanks

  • Problem in EP when executing a workbook

    Hi all, in the Enterprise Portal I get this error message: WSATYPE_NOT_FOUND The specified class not found RELEASE 710 COMPONENT NI (network interface) VERSION 39 RC -1 MODULE ninti.c LINE 938 DETAIL NiPGetServByName: 'sapmsBAD' not found SYSTEM CALL

  • Bursting to fax not in landscape

    I have a burst control file that emails, prints and faxes pdf with one problem. When sent to the fax as landscape it faxes as portrait - printers and email are ok. I am running CUPS with Hylafax if that helps Bob Harrison

  • How can I upgrade Office 2011 14.1.0 in Mavericks?

    Hello! I just installed Mavericks on my Mac Book. Using Office 2011, version 14.1.0. i tried to ugrade but upgrading to any newer version is not possible. It shows the following message: "A version of the software required to install this update was