Getting output in excel sheet from jsp file

Hi,
I am a new programmer. I am trying to get output in excel sheet by clicking a link on page. I have used that 2 statements
response.setContentType("application/x-download");
response.setContentType("application/Octet-Stream");
response.setHeader("Content- disposition","inline;filename=refdsxresults.xls");
But it is giving an empty excel sheet. I don't know how to put the data in that sheet which is retrieved by using the query below.
"select p.port_no,p.block_no,p.slot_no,p.channel_no,p.ref_no,"+
"p.rr,c.card_type,c.work_or_protect,p.port_status_code,p.tr_id,"+
"p.dest_rr,p.dest_shelf,p.dest_jack,p.mux,"+
"sid.work_order_number,sid.pon_a,sid.pon_z,"+
"sid.circuit_id,sid.account_name,sid.account_no,sid.order_no,sid.item_no,"+
"sid.a_city_code,sid.z_city_code,p.parent_port_no "+
"from eon_port p,eon_card c,sonet_item_detail sid "+
"where p.logical_flag='N' and p.card_no*=c.card_no and "+
"p.current_path_no*=sid.path_no and sid.action!='DISC' and sid.item_status!='CN' "+
"and p.equip_no="+equipNumber+
" order by p.ref_no";
and also can I use the HTML to get this result in the browser. Could you please give an example. I need it urgently.
Thanks in advance

In an earlier post, somebody was saying that you can use regular HTML tables to output an XLS file. I've never tried it, so I don't know it to be true, but give it a look:
http://forum.java.sun.com/thread.jsp?forum=45&thread=407280&tstart=0&trange=15
If that doesn't work, you can always return a CSV file (comma seperated values).

Similar Messages

  • Moving excel sheet from different files to excel template

    Hi Everyone,
    I need help from you guys.. I want to fetch excel sheet from different files (say for example from 3 excel files) and put in to one template file. If any one have idea regarding this please let me know. Thanks in advance
    Thanks & Regards
    saamy

    Hii Puneet K & nyc,
    Thanks a lot for ur links guys... am already done ...will upload the working code shortly...and am facing some other problem now...when I execute the program in LV 11.0 version its working fine, but when I try to run the same code in LV10.0 (32 bit machine) its showing this error
    "Error -2146827284 occurred at Exception occured in Microsoft Office Excel: Excel cannot insert the sheets into the destination workbook, because it contains fewer rows and columns than the source workbook. To move or copy the data to the destination workbook, you can select the data, and then use the Copy and Paste commands to insert it into the sheets of another workbook.Help Path is C:\Program Files\Microsoft Office\Office12\1033\XLMAIN11.CHM and context 0 in copy_excel_worksheet.vi
    This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.
    Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2146827284) or for its hexadecimal representation (0x800A03EC)."
    If you guys know the solution please let me knoe...thanks in advance..
    Thanks & Regards
    saamy

  • How to get data to excel sheet from background

    Hello Experts,
    I have be assigned a task where i have to find out all the reports and the variants containing a ' / '. I have written the code where i am able to scan through the entire list and get a set of reports and the variantsin the internal table. NOW i have to run the code in the background and the entire set of reports and the variants in the internal table to the excel sheet . So how do I do this? I am able to get the data in the excel sheet from the foreground using the FM GUI_download. But this FM does not work in the background.
    So what should be the ideal way to do this ?
    Thanks
    Aditya

    Hi,
    You can write the file into Application server.
    OPEN DATASET dataset FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      LOOP AT it_itab INTO wa_itab.
        TRANSFER wa_itab TO dataset.
      ENDLOOP.
      CLOSE DATASET dataset
    use CG3Y transaction to download file from app server to presentation server.
    Regards
    Sree

  • Opening Excel sheet from server

    Hi I have one requirement to open Excel Sheet.
    The Excel sheet is residing in a directory parallel to WEB-INF. I am using Jboss server in Linux. in UI whenever I click on link I have to open Excel sheet from the server. Before opening Excel sheet I have to fill with some data. i am using JSP/Servlets .
    Can any one help me on this?
    Guru

    this piece of code is just open a xsl file with writing some data on the file
    it may be helpful for u .i am giving only logic.
    import java.util.*;
    import java.io.* ;
    import java.text.* ;
    public class a{
         // Main method
         public static void main (String args[])
              // Stream to write file
              //File file;
              FileWriter fout;
              String TimeStamp;
              try
              // Open an output stream
              Calendar currentdate= Calendar.getInstance();
                   int currmonth=currentdate.get(Calendar.MONTH)+1;
                   String strMonth="";
                   if(currmonth<10)
                        strMonth="0"+currmonth;
                   String wbname="Equifax"+strMonth+currentdate.get(Calendar.YEAR)+".xls";
                   System.out.println(wbname);
              BufferedWriter outfile = new BufferedWriter(new FileWriter(wbname));
                   //file=new File(filename);
                   fout = new FileWriter (wbname);
              // Print a line of text
              TimeStamp = new java.util.Date().toString();
              //String filename1=file.getName();
              outfile.write(" Apply ");
              // Close our output stream
              outfile.close();          
              // Catches any error conditions
              catch (IOException e)
                   System.err.println ("Unable to write to file");
                   System.exit(-1);
    }

  • How GET Output to Excel with Oracle9i Report using OC4J

    how GET Output to Excel with Oracle9i Report using OC4J.
    I FINISHED THE SETPS CONCIDERING THE JSP CODE NEEDED TO GET THE EXCEL OUTPUT ON LOCAL MACHINE.
    I NEED TO PUBLISH THIS REPORT THROUGH APPLICATION SERVER.
    THE QUESTION IS:
    1- HOW TO START AN OC4J INSTANCE FROM ORACLE 9I DS FOR THIS REPORT?
    2- WHERE (PATH) TO PUBLISH THE REPORT ON THE APPLICATION SERVER?
    3- WHAT IS THE DEFAULT URL TO RUN THIS REPORT AND WHERE TO PUT IT?
    4- HOW TO MAKE MAPPING FOR DIRECOTRY PATH TO TRANSLATED AS URL FOR THIS REPORT?
    5- IF ANY ONE CAN GIVE ME THE FULL CODE TO RUN AND CALL SIMPLE JSP REPORT TO BE VIED IN INTERNET EXPLORER.
    THANK YOU

    Hi,
    I can't answer to all your questions, however I can tell you that:
    2) The directory where to put the report file is specifiend in a file named
    <serverName>.conf
    in the sourceDire property
    <property name="sourceDir" value="/directory/dove/mettere/i/report"/>
    that you can find under ORACLE_HOME/reports/conf
    3) The URL is
    http://<server IAS address>:<port number>/<jsp file path>/<repName>.jsp?server=<report server name>&userid=<user>/<pwd>@<DB conn string>[&<param>=<valore>[&...]]
    5) In IE you have only to set the previous URL in the address bar.
    Hope this helps you
    Bye
    Raffy

  • Problem when opening excel sheet in jsp

    Hi friends
    When i try to open excel sheet from my program I am getting two problems
    1. first row of excel sheet is empty
    2. while opening I am getting error message of "the file is not in a recognizable format"
    Please help me..It is an urgent work
    my code
    <%@page language="java" import="java.io.*,java.text.*,java.sql.*,java.util.*"%>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    Connection conn = DriverManager.getConnection("jdbc:mysql://256.136.119.86/mydb","zzz","zzz");
    Statement st = conn.createStatement();
    StringBuffer sb = new StringBuffer();
    sb.append("SAP#" + "\t");
    sb.append("x-plant status" + "\t");
    sb.append("Total Amount" +"\t");
    sb.append(">90 days" + "\t");
    sb.append("\n");
    try
    String query="select * from temp_Xplant";
    ResultSet rs = st.executeQuery(query);
    while(rs.next()){
    sb.append(rs.getString("sapNo") + "\t");
    sb.append(rs.getString("status")+ "\t");
    sb.append(rs.getString("amt") + "\t");
    sb.append(rs.getString("days") + "\t");
    sb.append("\n");
    conn.close();
    st.close();
    catch (Exception e)
    out.println("error");
    conn.close();
    st.close();
    response.setContentType("application/vnd.ms-excel");
    // response.setHeader("Content-Disposition", "attachment; filename=\"test.xls\"");
    String testt = "tests.xls";
    response.setHeader("Content-Disposition", "attachment; filename="+testt);
    out.println(sb.toString());
    out.close();
    %>
    thanks in advance

    The problem here is, you have setted the content type as excel sheet and you are writing some String content into the output stream. when excel tries to read the String content it will surely throw some error. Lot of excel APIs are available in the market to generate excel sheets.
    you can find one in the below URL.
    http://www.teamdev.com/downloads/jexcel/docs/JExcel-PGuide.html

  • How to open and read Excel Sheet from SharePoint 2013 Document Library using C# Visual Studio 2012

    Hi,
    To achieve these are the steps that I had followed :
    1. Add the document Library path into Central Admin -> Application Mgmt -> Manage Service App -> Excel Service App -> Trusted File Locations
    2. Add Documnet Library link to Trusted Connection Proivder
    3. Open Visual Studio as Run as Administrator
    4.Create an SharePoint 2013 Empty Project.
    5.Add Service Reference : http:\\<server>\_vti_bin/excelservice.asmx
    6.Service added successfully
    7.Create a class file and add the Service Reference namespace
    There is no such class as ExcelService to call. 
    Please let me know if somebody knows how to open the Excel file into C#(2012)  either using ExcelService or any other way to open. I tried old methods of Sharepoint 2010 server but it's not able to access classes.
    Requirement is :
    Need to read the excel sheet  from Document Library and transfer all data into DataTable.
    Please help asap. 

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Office, I'll move your question to the SharePoint 2013 development forum
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/home?forum=sharepointdevelopment
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support

  • Sending an Email by taking excel sheet from Application Server.

    Hi.
    I Searched in SDN related 'Sending an Email by taking excel sheet from Application Server'.
    But i didnt get. I got sending mails from local pc.
    Can some bdy provide me sample code how to send mail with an attachment. the attached file should get from Application Server
    Regards,
    Renu

    Hi,
    For writing data to app server from internal table:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/prog%252bon%252bopen%252bdataset%252binput
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/prog%252bon%252bopen%252bdataset%252boutput
    Checkout this wiki for sending XL in mail attachment:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/multiple%252battachment%252bon%252be_mail
    Thanks,
    Krishna

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

  • Output to Excel sheet

    How to copy the contents of output into excel sheet?

    Hi,
    Check the below example, to download the ALV report output to an excel sheet.
    REPORT Z_CONCEPTALV .
    TABLES: KNA1,VBAK.
    DATA: ITAB TYPE TABLE OF VBAK,
    CONTAINER TYPE SCRFNAME VALUE 'ALVCONTROL',
    CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
    GRID TYPE REF TO CL_GUI_ALV_GRID,
    L_CONTAINER TYPE SCRFNAME VALUE 'LOGO',
    I_PARENT TYPE REF TO CL_GUI_CONTAINER,
    L_CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
    TREE TYPE REF TO CL_GUI_ALV_TREE_SIMPLE,
    LT_LIST_COMMENTARY TYPE SLIS_T_LISTHEADER,
    L_LOGO TYPE SDYDO_VALUE.
    DATA: OK_CODE(4).
    CALL SCREEN 1100.
    *& Module STATUS_1100 OUTPUT
    text
    MODULE STATUS_1100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    CASE OK_CODE.
    WHEN 'DISP'.
    SELECT * FROM VBAK INTO TABLE ITAB WHERE KUNNR = KNA1-KUNNR.
    IF CUST IS INITIAL.
    CREATE OBJECT CUST EXPORTING CONTAINER_NAME = CONTAINER.
    CREATE OBJECT GRID EXPORTING I_PARENT = CUST.
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING I_STRUCTURE_NAME
    = 'VBAK' CHANGING IT_OUTTAB = ITAB.
    ENDIF.
    IF L_CUST IS INITIAL.
    CREATE OBJECT L_CUST EXPORTING CONTAINER_NAME = L_CONTAINER.
    CREATE OBJECT TREE EXPORTING I_PARENT = L_CUST.
    PERFORM BUILD_COMMENT USING LT_LIST_COMMENTARY.
    CALL METHOD TREE->CREATE_REPORT_HEADER EXPORTING IT_LIST_COMMENTARY =
    LT_LIST_COMMENTARY I_LOGO = L_LOGO.
    ENDIF.
    WHEN 'DOWN'.
    PERFORM F_DOWNLOAD_TO_EXCEL.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE. " STATUS_1100 OUTPUT
    FORM BUILD_COMMENT USING LT_LIST_COMMENTARY.
    L_LOGO = 'ENJOYSAP_LOGO'.
    ENDFORM.
    FORM F_DOWNLOAD_TO_EXCEL.
    CALL FUNCTION 'DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = ' '
    CODEPAGE = ' '
    FILENAME = ' '
    FILETYPE = 'DAT'
    ITEM = ' '
    MODE = ' '
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    FILEMASK_MASK = ' '
    FILEMASK_TEXT = ' '
    FILETYPE_NO_CHANGE = ' '
    FILEMASK_ALL = ' '
    FILETYPE_NO_SHOW = ' '
    SILENT = 'S'
    COL_SELECT = ' '
    COL_SELECTMASK = ' '
    NO_AUTH_CHECK = ' '
    IMPORTING
    ACT_FILENAME =
    ACT_FILETYPE =
    FILESIZE =
    CANCEL =
    TABLES
    DATA_TAB = ITAB
    FIELDNAMES =
    EXCEPTIONS
    INVALID_FILESIZE = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    CUSTOMER_ERROR = 7
    OTHERS = 8
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    Refer these links:
    Export ALV List into Excel Sheet
    How to convert alv list into excel file?
    Reward points if found helpful...
    Cheers,
    Chandra Sekhar.

  • Problem getting output in Excel

    Hi!
    I'm having problems with getting output in excel.
    I generated report that gives me xml and it was ok.
    Then I started concurrent to merge template and this xml and chosed Excel as output.
    When I try to open it in IE all I'm getting is
    End tag 'p' does not match the start tag 'a'. Error processing resource 'http://testserver.hlutrija.hr:8001/OA_CGI/FNDWRR.e...
    <td class="c2"><p class="c8"><a name="Text35" id="Text35"><a name="Text34" id="Text34"><span cla...
    When I try to view output from Firefox(it's more forgiving for incorrect xml then IE) it opened the whole document as a text (no xml, no excel but text - I saw that on a page info).
    Anyway I realized that indeed generated xml wasn't correct since one <a tag wasn't closed.
    But I tried to copy/paste to text editor and save as .xls file and it opened it OK.
    But this certainly isn't the solution you would wan't to offer to a client.
    On this instance XML is 5.0.
    I tried bunch of things to make it open directly in Excel (I believe that then it wouldn't have any problems - ie when I used preview on defining template it offered me to open or save in Excel and I got what I wanted).
    I tried to define Viewer Options (added applications/vnd.ms-excel for XML, HTML, Text Desc: Microsoft Excel), set the profile Viewer:Application for HTML/XML/Text to Microsoft Excel). But that didn't help either.
    I even tried defining new Profile -> Viewer:Application for Excel based on similar Profiles. But this also didn't help.
    Every time the result is the same both in IE(stops because of bad xml) and Firefox (I get bad xml recognized as text).
    On another instance I have xmlp v 5.6.2
    There I have some sample report and sample template.
    When I there try to open output in Firefox once again I get xml recognized as text.
    When I try to open in IE(7.0) I get a page that looks like html in browser.On the Page file menu I have option to edit in Excel. When I choose that it opens Excel but instead of this same page I only get: Authentication failed.
    When I try to save this page it offers me only web formats (whole web page...). But nevertheless I tell it to save like test.xls. It saves ok. But when I try to open it. Excel starts but again all I get is: Authentication failed.
    When I open this in text editor it has only:
    From: <Saved by Windows Internet Explorer 7>
    Subject:
    Date: Thu, 30 Aug 2007 14:28:37 +0200
    MIME-Version: 1.0
    Content-Type: text/html;
         charset="iso-8859-2"
    Content-Transfer-Encoding: 7bit
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
    Content-Location: http://server.client.hr:8002/OA_CGI/FNDWRR.exe?temp_id=3132885517
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html; charset=iso-8859-2">
    <META content="MSHTML 6.00.6000.16525" name=GENERATOR></HEAD>
    <BODY><PRE>Authentication failed.
    </PRE></BODY></HTML>
    I really don't have any more ideas.
    I've searched this forum, metalink, web, but nothing yet helped.
    Can anyone help?

    Is your xml file being generated correctly?
    For the request that you submitted, click the 'View Details' button. If the 'View XML' button is enabled, click that and it will open your XML in a new browser.
    If it's not enabled, the request needs to be changed so its output is XML.
    Not sure if this will help, but at least it will eliminate that there is anything wrong with the file or data.
    Janel

  • Excel sheets from Oracle reports

    Is there any way to save the ouput of Oracle reports as an excel sheet?
    I know it is possible to take the output as a text file and open the file from the Excel sheet. but the file is text, with no layout format, fonts,...
    I tried to save it as HTML but when it is open from Excel each character is put on a distinct

    I have the same problem. Please let me know if you found a solution. Like you said it is possible to create a comma delimited file from Reports which can then be opened from Excel. Is there an easier way?
    Thanks
    Tertius

  • Genarating Excel sheets from PL/SQL

    Hi all,
    I have to genarate an excel sheet from the PL/SQL.Simply need to send the oracle data into Excel sheet Using PL/SQL.Could you give anyidea to do that ?
    Thanks in Advance
    Srikanth,Ponakala

    I'm still learning but I can give an answer a go :) Excel will take in numerous formats, comma delimited etc, so if you use the spool function capturing the output using cursors.. something like..
    spool excelfile
    declare
    cursor c1 is
    select foo,foo2
    from bar
    where foo = 'foo';
    c1_rec c1%rowtype;
    begin
    if not c1%isopen then
    open c1;
    end if;
    fetch c1 into c1_rec;
    while c1%found loop
    dbms_output.put_line(c1_rec.foo || ',' || c1_rec.foo2);
    fetch c1 into c1_rec;
    end loop;
    close c1;
    end;
    spool off;
    the spool will create a excel.lst file on your hdd (hopefully) ;)
    The file can then be imported into excel simply enough. Change the delimiter to something a bit more unique if your data has commas spattered in it :]
    Regards,
    Anthony...

  • Down Loading ALV Output to Excel Sheet

    Hi All,
    I am working on Vendor Line Items Report which have both Header details as well as line item details.
    So i developed Heirarical ALV to display the output and it is working fine.But my problem is Downloading output to Excel sheet functionality is not working.
    In output screen LIST->EXPORT->SPREADSHEET functionality is not working.
    Please give me suggestions regarding the same or is there any another way to do the same by using ALV List Display.
    Points will be rewarded
    Thanks and Regards,
    Siva.

    hi ,
    this is a working example check this...
    REPORT  zvenkattest0.
    TABLES:pa0002,pa0008.
    TYPE-POOLS:slis.
    CONSTANTS:c VALUE 'X'.
    DATA:BEGIN OF it_pa0008 OCCURS 0,
         pernr LIKE pa0008-pernr,
         begda LIKE pa0008-begda,
         endda LIKE pa0008-endda,
         preas LIKE pa0008-preas,
         ansal LIKE pa0008-ansal,
         lga01 LIKE pa0008-lga01,
         expand TYPE xfeld,
         END OF it_pa0008.
    DATA:BEGIN OF it_pa0002 OCCURS 0,
         pernr LIKE pa0002-pernr,
         vorna LIKE pa0002-vorna,
         nachn LIKE pa0002-nachn,
         gbdat LIKE pa0002-gbdat,
         gblnd LIKE pa0002-gblnd,
         sprsl LIKE pa0002-sprsl,
         perid LIKE pa0002-perid,
         END OF it_pa0002.
    DATA: wa_field_cat TYPE slis_fieldcat_alv,
          it_field_cat TYPE slis_t_fieldcat_alv,
          wa_keyinfo TYPE slis_keyinfo_alv,
          it_layout TYPE slis_layout_alv.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:s_pernr FOR pa0002-pernr NO INTERVALS.
    SELECTION-SCREEN: SKIP.
    PARAMETERS:p_expand AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
    PERFORM select_data.
    PERFORM build_field_cat.
    PERFORM disply_data.
    *&      Form  SELECT_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM select_data .
    SELECT pernr
           begda
           endda
           preas
           ansal
           lga01
           FROM pa0008
           INTO CORRESPONDING FIELDS OF TABLE it_pa0008
           UP TO 10 ROWS.
    IF NOT it_pa0008[] IS INITIAL.
    SELECT pernr
           vorna
           nachn
           gbdat
           gblnd
           sprsl
           perid
           FROM pa0002
           INTO CORRESPONDING FIELDS OF TABLE it_pa0002
           FOR ALL ENTRIES IN it_pa0008
           WHERE pernr = it_pa0008-pernr.
    ENDIF.
    SORT it_pa0008 BY pernr.
    ENDFORM.                    " SELECT_DATA
    *&      Form  BUILD_FIELD_CAT
          text
    -->  p1        text
    <--  p2        text
    FORM build_field_cat .
        wa_field_cat-tabname = 'PA0008'.
        wa_field_cat-fieldname = 'PERNR'.
        wa_field_cat-seltext_l = 'personnelno'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0008'.
        wa_field_cat-fieldname = 'BEGDA'.
        wa_field_cat-seltext_l = 'begindate'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0008'.
        wa_field_cat-fieldname = 'ENDDA'.
        wa_field_cat-seltext_l = 'enddate'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0008'.
        wa_field_cat-fieldname = 'PREAS'.
        wa_field_cat-seltext_l = 'reason'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0008'.
        wa_field_cat-fieldname = 'ANSAL'.
        wa_field_cat-seltext_l = 'annualsalary'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0008'.
        wa_field_cat-fieldname = 'LGA01'.
        wa_field_cat-seltext_l = 'wagetype'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0002'.
        wa_field_cat-fieldname = 'VORNA'.
        wa_field_cat-seltext_l = 'firstname'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0002'.
        wa_field_cat-fieldname = 'NACHN'.
        wa_field_cat-seltext_l = 'lastname'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0002'.
        wa_field_cat-fieldname = 'GBDAT'.
        wa_field_cat-seltext_l = 'birhtdate'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0002'.
        wa_field_cat-fieldname = 'GBLND'.
        wa_field_cat-seltext_l = 'birthcountry'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0002'.
        wa_field_cat-fieldname = 'SPRSL'.
        wa_field_cat-seltext_l = 'languageused'.
        APPEND wa_field_cat TO it_field_cat.
        wa_field_cat-tabname = 'PA0002'.
        wa_field_cat-fieldname = 'PERID'.
        wa_field_cat-seltext_l = 'personnelid'.
        APPEND wa_field_cat TO it_field_cat.
    ENDFORM.                    " BUILD_FIELD_CAT
    *&      Form  DISPLY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM disply_data .
      it_layout-group_change_edit = c.
      it_layout-colwidth_optimize = c.
      it_layout-zebra             = c.
      it_layout-detail_popup      = c.
      it_layout-get_selinfos      = c.
      IF p_expand = c.
      it_layout-expand_fieldname  = 'EXPAND'.
      ENDIF.
      wa_keyinfo-header01 = 'PERNR'.
      wa_keyinfo-item01 = 'PERNR'.
    wa_keyinfo-item02 = 'SUBTY'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          is_layout               = it_layout
          it_fieldcat             = it_field_cat
          i_tabname_header        = 'PA0008'
          i_tabname_item          = 'PA0002'
          is_keyinfo              = wa_keyinfo
        TABLES
          t_outtab_header         = it_pa0008
          t_outtab_item           = it_pa0002.
    ENDFORM.                    " DISPLY_DATA
    regards,
    venkat.

  • How can I download to one excel sheet from more than two table?

    Hi.
    as you know
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER='DATAPROVIDER_T1' >
    this script can make download excel sheet which is same cotents of table or chart in web template.
    but if template has more than two tables how can we get excel sheet from tables?
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER_1='DATAPROVIDER_T1' DATA_PROVIDER_2='DATAPROVIDER_T2'>
    I hope this gonna work but result was fail same as I expected.
    is there any way put two tables download one excel sheet?

    Welcome to SDN.
    Post this in Business Explorer forum for quicker resposne.
    SAP Business Explorer (SAP BEx)
    Regards
    Raja

Maybe you are looking for