Excel download with multiple worksheets using ABAP webdynpro

Content of Internal table should to downloaded  to an excel sheet with multiple worksheet.

Excel doesn't support multiple worksheets with the text tab delimited or any of the other plain text formats.  So if you need multiple worksheets those approaches are out.  Multiple worksheets would only work with the Excel native format or the XML based format.  From ABAP the best approach would be to create the XML Excel format.  Search the forms and wiki has there has been tons of discussion in the mast on the XML Excel format.

Similar Messages

  • C# Script to open and read an Excel spreadsheet with multiple worksheets

    Can someone provide me the C# syntax and Edit Script to open an Excel spreadsheet with multiple worksheets and then using the data to create and output a .csv file? The multiple worksheets contain different data elements that I'll need to parse out and then
    store as a .csv file that will then be read to pump data into our SQL Server Database.
    Thanks for your review and am hopeful for a reply.
    PSULionRP

    I think this code originally came from Joel, who comes here quite a bit.  I'm not a C# expert, like Joe is, but I think this is pretty close to what you want.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Excel = Microsoft.Office.Interop.Excel;
    using Microsoft.Office.Interop.Excel;
    using System.IO;
    namespace WindowsFormsApplication2
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Main();
    public void Main()
    string filePath = "C:\\Users\\Ryan\\Desktop\\MainExcel.xlsx";
    Microsoft.Office.Interop.Excel.Application xlobj = new Microsoft.Office.Interop.Excel.Application();
    Workbook w = default(Workbook);
    Workbook w1 = default(Workbook);
    Worksheet s = default(Worksheet);
    Worksheet s1 = default(Worksheet);
    Worksheet xlsht = default(Worksheet);
    xlobj.Visible = true;
    int intItem = 1;
    DirectoryInfo dirSrc = new DirectoryInfo(@"C:\Users\Ryan\Desktop\Test_Folder\");
    foreach (FileInfo ChildFile in dirSrc.GetFiles())
    try
    // Renaming the excel sheet
    w = xlobj.Workbooks._Open(ChildFile.FullName,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    w1 = xlobj.Workbooks._Open(filePath,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    //this doesn't make any sense
    //w1 = xlobj.Workbooks.Open(filePath);
    //if (intItem > 3)
    Excel.Worksheet lastSht =
    (Excel.Worksheet)w1.Worksheets[w1.Worksheets.Count];
    xlsht = (Excel.Worksheet)w1.Worksheets.Add(Type.Missing,
    lastSht,
    Type.Missing, Type.Missing);
    s = (Excel.Worksheet)w.Worksheets[1];
    s1 = (Excel.Worksheet)w1.Worksheets[intItem];
    s1.Name = ChildFile.Name;
    // it will copy and paste sheet from one to another with formula
    s.UsedRange.Copy(Type.Missing);
    Excel.Range r = s1.get_Range("A1", Type.Missing);
    r.PasteSpecial(Excel.XlPasteType.xlPasteValues,
    Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone,
    Type.Missing, Type.Missing);
    s1.UsedRange.Formula = s.UsedRange.Formula;
    // Renaming the excel sheet
    //w.Save();
    w.Close(false, Type.Missing, Type.Missing);
    w1.Close(false, Type.Missing, Type.Missing);
    catch (Exception ex)
    //w.Save();
    w1.Save();
    w.Close(false, Type.Missing, Type.Missing);
    w1.Close(false, Type.Missing, Type.Missing);
    intItem = intItem + 1;
    //Dts.TaskResult = ScriptResults.Success
    Do you need help getting everything into a CSV, or can you take it from here???
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Excel Upload With Multiple Worksheets

    Friends,
    I have requirement wherein I have to read data from an excel file with multiple worksheets. I have gone through some earlier postings but most of them explain about creating an excel file with multiple worksheets (which is right oppsite of what I need to do)
    I am trying to understand the concept of OLE and implement it but am finding it tricky!
    Please help me out!
    Thanks,
    Shyam

    See this site: AN EASY REFERENCE FOR OLE AUTOMATION by Serder Simsekler.
    Best!
    Jim

  • How can i create  excel sheet with multiple tabs using utl file?

    how can i create excel sheet with multiple tabs using utl file?
    any one help me?

    Jaggy,
    I gave you the most suitable answer on your own thread yesterday
    Re: How to Generating Excel workbook with multiple worksheets

  • Excel sheet with multiple tabs to be sent as email

    Hi Experts,
    I have a requirement to generate an Excel sheet with multiple tabs to be sent as email to a distribution list.
    Please help if you have any ideas on the same.
    Thanks,
    Preema

    [http://wiki.sdn.sap.com/wiki/display/ABAP/ToGetFieldDetailsSavedinVariantLayout|http://wiki.sdn.sap.com/wiki/display/ABAP/ToGetFieldDetailsSavedinVariantLayout]
    with this we can get the modified field catalog  based on layout variant
    without calling alv output function modules
    Thanks!   SDN.

  • Excel Template with Multiple Sheets

    Hi everyone,
    I need to build Excel template with multiple sheets where each sheet should have at-least one chart.
    Thanks
    Aravind

    Hi
    Could you please explain those ways here.?
    Many Thanks,
    BK

  • File to RFC with multiple records using BPM Scenario Error...!!!

    Hello Guru's,
      I have done the File to RFC with multiple records using BPM scenario as per the Materiel available in the sdn.sap. This involves BAPI (BAPI_MATERIEL_AVAILABILITY). I have done exactly the same what is their in the materiel. SXI_CACHE is also giving return value " 0 ". File is getting deleted from the source directory, but no file in target directory. SXMB_MONI is also showing no error (black Flag). BPM is also error free. Checked the interfaces also.
    Can any one tell me what mistake would i have done.
    Thanks in advance.

    Hi,
    There is one similar discussion I found,
    FTP TO RFC using BPM
    Thanks
    Swarup

  • Open Transaction MM01/MM02 with multiple views using  CALL TRANSACTION

    Hi All,
    I want to open MM01/MM02 with multiple views using call transaction but in the parameter ID for Views (MMX) I can pass status of only one View.
      SET PARAMETER ID 'MAT' FIELD v_mat.
      SET PARAMETER ID 'VKO' FIELD ' '.
      SET PARAMETER ID 'MTA' FIELD IT_MOFF-MTART.
      SET PARAMETER ID 'MTP' FIELD IT_MOFF-MBRSH.
      SET PARAMETER ID 'VTW' FIELD ' '.
      SET PARAMETER ID 'BWT' FIELD ' '.
      SET PARAMETER ID 'LGT' FIELD ' '.
      SET PARAMETER ID 'MXX' FIELD 'K'.     "Sales View
      SET PARAMETER ID 'MM5' FIELD ' '.
      CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN
    Please suggest.
    Regards,
    Divya

    I do not exactly understand what you mean, but what i already did:
    - I checked that the fields are from the same type.
    - KUNNR is initialized! I already had a look to the debugger, that's why i'm posting this in this forum.
    any more comments on this ?
    maybe i have to change anything in the z-transaction. Btw, this is what the parameter looks like in the transaction:
    SELECTION-SCREEN BEGIN OF BLOCK Debitoren WITH FRAME TITLE text-001.
      PARAMETERS pkunnr type kna1-kunnr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK Debitoren.
    Edited by: Sven Delangle on Sep 3, 2010 2:42 PM

  • Can I communicate single PXI chassis with multiple computer using MXI

    Can I communicate single PXI chassis with multiple computer using multiple MXI cards
    we are using cvi with MXI we want to share channels for other computers Can we do with mxi 

    Yes this is possible when you use a PXI controller.  Attached is a screenshot showing a possible configuration.
    Jacob K || Applications Engineer || National Instruments
    Attachments:
    PXIMaster.png ‏20 KB

  • Send email with multiple attachments using MS outlook

    Hi,
    Is it possible to send an email with multiple attachments using MS outlook. (Using activex)
    Regards,
    Neha

    nehrnul wrote:
    Hey thanks for the reply. I'll try that way also.
    but currently my requirement is to send email using MS Outlook. And I found 1 solution using invoke node
    Regards,
    Neha
    That' "requirement" sounds like it was written by someone who is trying to drive the design of the application.  Without knowing your personal situation it's hard for me to say, but if I had to guess I would say the real requirement is to send an email with multiple attachements, and the person giving that requirement thought sending it through Outlook would be the best way.  You should get clairification on what the real intend of that requirement is.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How to generate a report in Excel with multiple sheets using oracle10g

    Hi,
    I need a small help...
    we are using Oracle 10g...
    How to generate a report in Excel with multiple sheets.
    Thanks in advance.
    Regards,
    Ram

    Thanks Denis.
    I am using Oraclereports 10g version, i know desformat=spreadsheet will create single worksheet with out pagination, but my requirment is like the output should be generated in .xls file, and each worksheet will have both data and graphs.
    rdf paperlayout format will not workout for generating multiple worksheets.
    Is it possible to create multiple worksheets by using .jsp weblayout(web source) in oracle reports10g. If possible please provide me some examples
    Regards,
    Ram

  • How to create a view to display Multiple lines of Text using ABAP WebDynpro

    Hi,
    I need to create a static view page in ABAP WebDynpro that displays Static text data in multiple paragraphs. I tried to use textview, formatted text, text edit controls by binding the textcontrol to a text object that is created in so10, but the output I am getting is only one line and the character count is limited to 60 to 65 characters.
    I would like to know which control needs to be used in ABAP Webdynpro to get multiple lines displayed with text formatting like Paragraph, Indenting and Size.....
    Thanks for your time!
    Madhavi.

    Find the sample codes:
      data sapscript_lines     type tlinetab.
      data sapscript_lines1     type tlinetab.
      data sapscript_tline     type tline.
      data sapscript_head      type thead.
      data text                type string.
      data formatted_text type ref to cl_wd_formatted_text.
      call function 'DOCU_GET'
        EXPORTING
          id                = 'TX'
          langu             = 'D' "Germany language
          object            = 'WDR_TEST_HELP_EXP1'
        IMPORTING
          head              = sapscript_head
        TABLES
          line              = sapscript_lines
        EXCEPTIONS
          no_docu_on_screen = 1
          no_docu_self_def  = 2
          no_docu_temp      = 3
          ret_code          = 4
          others            = 5.
      if sy-subrc <> 0.
        text = space.
      endif.
      formatted_text = cl_wd_formatted_text=>create_from_sapscript(
        sapscript_head  = sapscript_head
        sapscript_lines = sapscript_lines
      " set it into the context
      if Not ( formatted_text is initial ).
        wd_context->set_attribute(
        name  = 'FORMATTED'
        value = formatted_text->m_xml_text ).
      endif.
    clear sapscript_head.
    clear sapscript_lines.
    *Get the text created by SO10
    CALL FUNCTION 'READ_TEXT_INLINE'
      EXPORTING
        ID                    = 'ST'
        INLINE_COUNT          = 1
        LANGUAGE              = 'E' "English language
        NAME                  = '85XX_FOOTER'
        OBJECT                = 'TEXT'
      LOCAL_CAT             = ' '
    IMPORTING
       HEADER                = sapscript_head
      TABLES
        INLINES               = sapscript_lines1
        LINES                 = sapscript_lines
    EXCEPTIONS
      ID                    = 1
      LANGUAGE              = 2
      NAME                  = 3
      NOT_FOUND             = 4
      OBJECT                = 5
      REFERENCE_CHECK       = 6
      OTHERS                = 7
      formatted_text = cl_wd_formatted_text=>create_from_sapscript(
        sapscript_head  = sapscript_head
        sapscript_lines = sapscript_lines
      " set it into the context
      if Not ( formatted_text is initial ).
        wd_context->set_attribute(
        name  = 'FORMATTED1'
        value = formatted_text->m_xml_text ).
      endif.

  • Excel download feature in Web Dynpro Abap using OAOR document

    Hi Friends,
    I am facing an issue in implementing excel download feature in Web Dynpro.
    Problem: I have stored an excel document in OAOR. I am displaying data on screen using ALV display in WDA.
    I will provide a button to download excel in toolbar of ALV. When user clicks on this button i need to pick the document from OAOR and fill that with my screen values and download it to users desktop.
    Please help me in this. Problem is when i am calling these classes c_oi_container_control_creator=>get_container_control and cl_gui_custom_container from my View's method they are returning error.
    Thanks & Regards,
    Saud

    HI,
    You cannot use GUI classes and methods in web dynpro . That will dump.
    Instead you can use file down load UI element or..
    If you have the content in xstring format use ATTACH_FILE_TO_RESPONSE method of CL_WD_RUNTIME_SERVICES class.
    Regards,
    Madhu

  • Export data to excel with multiple worksheet

    Hi all,
    Thanks to Roel, Andy, Scott, and Varad. I could go this far with my first project with APEX :)
    thank you guys !!
    I am left with one last bit (unless the client request more feature). I need to export the database to an excel spreadsheet.
    I have about 5 tables so I need to create 5 worksheet in the excel file.
    Now I have tried OWA_SYLK from Tom (http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:728625409049#PAGETOP)
    it works in my environment, but I just don't know how to create multiple worksheet in one excel file.
    I read on the internet that XML spreadsheet is the answer but how to do that, I don't know.
    Can anyone enlighten me?
    Thanks.
    Joel

    It's easy with free RXLS PL/SQL library :
    Procedure Test_002 is
    wbk RXLS.XLS_WorkBook; -- workBook data structure
    f1 integer; f2 integer; -– two workSheets
    Begin
    RXLS.NewWorkBook (wbk); -- new WorkBook init.
    -- two worksheets creation
    f1 := RXLS.NewSheet (Wbk,'Departments');
    f2 := RXLS.NewSheet (Wbk,'Employees');
    -- Writing into the first WorkSheet data from the first SQL request (DEPT)
    RXLS.SQLtoXLS (xSQL => 'select * from Dept', xSheet => f1, xWbk => wbk, xR => 3, xC=> 2,
    xMaxRows => 100, xMaxCols => 20);
    -- Writing into the second WorkSheet data from the second SQL request (EMP)
    RXLS.SQLtoXLS (xSQL => 'select * from Emp', xSheet => f2, xWbk => wbk, xR => 1, xC => 3,
    xMaxRows => 20, xMaxCols => 10);
    -- Excel Workbook or Open Office document , (MS XML 2003 format)
    RXLS.GenXLS (wbk);
    -- Dowload to IE or FF
    RXLS.Show (wbk);
    end; -- ex 2
    [www.rci-informatique.fr/rxls]

  • How to display HTML files using ABAP Webdynpro?

    Hi,
    I have a html index file and a bunch of other files accessed by the index file  in a specific directory on the SAP server. I'd like to display the index file via ABAP webdynpro and allow the users to click on what they need to see. How can I achieve this using utilizing the ABAP webdynpro technology ?
    Thanks!

    Hi Thomas,
    Thanks for taking the time to answer my question.
    I have the main html file and all other files needed by the main file in one directory on the application layer of SAP. I'd like to provide the user with a link, by clicking on which they should be able to get to the main html file using the browser. This is just a standalone application.
    I can try the approach using BSPs, however, I'm new to that area. Could you point me in the right direction to get started?

Maybe you are looking for