[webdynpro] How to get the data from database and store in Excel sheet

Hi All-
I am developing an application in Webdynpro and I need to provide a URL ( link ) which if clicked , need to collect the data from Database ( SQL Server ) and puts in an Excel Sheet corresponding fields and opens the sheet.....
Please look into this issue and help me out......
Regards,
Cris

Hi Cris,
Add-on to wat santosh has pointed to:
Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)
(Or) If you have implemented your logic to get Database records below Blog should guide you in opening an excel with ur records.
Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)
Regards,
N.

Similar Messages

  • How to extract the data from module pool program to Excel Sheet?

    Hi Guys
            I am having a requirement to transfer the data from Module pool screen to excel sheet directly.
            This is an urgent requirement.
            So plz reply me with some coding examples.
            I will give points for that.

    This report extract excel file. From that concept you can easily extract data from module pool program also by coding in PAI of the screen.
    REPORT ztest1 .
    * 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
          h_c type ole2_object.            " color
    DATA: FILENAME LIKE RLGRAP-FILENAME.
    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.
    * 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 200 'Carrier id'(001).
      perform fill_cell using 1 2 1 200 'Connection id'(002).
      perform fill_cell using 1 3 1 200 'City from'(003).
      perform fill_cell using 1 4 1 200 'City to'(004).
      perform fill_cell using 1 5 1 200 'Dep. Time'(005).
      loop at it_spfli.
    * copy flights to active EXCEL sheet
        h = sy-tabix + 1.
        if it_spfli-carrid cs 'AA'.
          perform fill_cell using h 1 0 000255000 it_spfli-carrid.
        elseif it_spfli-carrid cs 'AZ'.
          perform fill_cell using h 1 0 168000000 it_spfli-carrid.
        elseif it_spfli-carrid cs 'JL'.
          perform fill_cell using h 1 0 168168000 it_spfli-carrid.
        elseif it_spfli-carrid cs 'LH'.
          perform fill_cell using h 1 0 111111111 it_spfli-carrid.
        elseif it_spfli-carrid cs 'SQ'.
          perform fill_cell using h 1 0 100100100 it_spfli-carrid.
        else.
          perform fill_cell using h 1 0 000145000 it_spfli-carrid.
        endif.
        if it_spfli-connid lt 400.
          perform fill_cell using h 2 0 255000255 it_spfli-connid.
        elseif it_spfli-connid lt 800.
          perform fill_cell using h 2 0 077099088 it_spfli-connid.
        else.
          perform fill_cell using h 2 0 246156138 it_spfli-connid.
        endif.
        if it_spfli-cityfrom cp 'S*'.
          perform fill_cell using h 3 0 155155155 it_spfli-cityfrom.
        elseif it_spfli-cityfrom cp 'N*'.
          perform fill_cell using h 3 0 189111222 it_spfli-cityfrom.
        else.
          perform fill_cell using h 3 0 111230222 it_spfli-cityfrom.
        endif.
        if it_spfli-cityto cp 'S*'.
          perform fill_cell using h 4 0 200200200 it_spfli-cityto.
        elseif it_spfli-cityto cp 'N*'.
          perform fill_cell using h 4 0 000111222 it_spfli-cityto.
        else.
          perform fill_cell using h 4 0 130230230 it_spfli-cityto.
        endif.
        if it_spfli-deptime lt '020000'.
          perform fill_cell using h 5 0 145145145 it_spfli-deptime.
        elseif it_spfli-deptime lt '120000' .
          perform fill_cell using h 5 0 015215205 it_spfli-deptime.
        elseif it_spfli-deptime lt '180000' .
          perform fill_cell using h 5 0 000215205 it_spfli-deptime.
        else.
          perform fill_cell using h 5 0 115115105 it_spfli-deptime.
        endif.
      endloop.
    * EXCEL FILENAME
      CONCATENATE SY-REPID '_' SY-DATUM+6(2) '_' SY-DATUM+4(2) '_'
                  SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
      CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.
      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 col 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.
      set property of h_f 'Color' = col.
      perform err_hdl.
    endform.                    "FILL_CELL
    *&      Form  ERR_HDL
    *       outputs OLE error if any                                       *
    *  -->  p1        text
    *  <--  p2        text
    form err_hdl.
      if sy-subrc <> 0.
        write: / 'OLE-Automation Error:'(010), sy-subrc.
        stop.
      endif.
    endform.                    " ERR_HDL

  • How to zip up data from database and store as blob

    I would like to know how best to zip up retrieved data from the database and store it as a blob back on to the database.
    Thanks.

    Hi Cris,
    Add-on to wat santosh has pointed to:
    Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)
    (Or) If you have implemented your logic to get Database records below Blog should guide you in opening an excel with ur records.
    Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)
    Regards,
    N.

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • How to get the data from multiple nodes to one table

    Hi All,
    How to get the data from multiple nodes to one table.examples nodes are like  A B C D E relation also maintained
    Regards,
    Indra

    HI Indra,
    From Node A, get the values of the attributes as
    lo_NodeA->GET_STATIC_ATTRIBUTES(  IMPORTING STATIC_ATTRIBUTES = ls_attributesA  ).
    Similarily get all the node values from B, C, D and E.
    Finally append all your ls records to the table.
    Hope you are clear.
    BR,
    RAM.

  • How to get the data from pcl2 cluster for TCRT table.

    Hi frndz,
    How to get the data from pcl2 cluster for tcrt table for us payroll.
    Thanks in advance.
    Harisumanth.Ch

    PL take a look at the sample Program EXAMPLE_PNP_GET_PAYROLL in your system. There are numerous other ways to read payroll results.. Pl use the search forum option & you sure will get a lot of hits..
    ~Suresh

  • How to get the data from Pooled Table T157E.

    Hi Experts,
    How to get the data from Pooled Table T157E.
    Any help.
    Thanks in Advance,
    Ur's Harsha.

    create some internal table similar to T157E and pass all data as per SPRAS.
    After that use internal table in your program as per the requirement.
    Regds,
    Anil

  • How to display the data from database(MS access) to a textbox

    anyone know ?

    how to display the data from database(MS access) to a
    textboxThe reply hasn't changed over these years. Read the tuutorial on how to fetch the data. You can display it anywhere you feel like. :)
    http://java.sun.com/docs/books/tutorial/jdbc/

  • How to get the data from a cluster table to BW

    Dear All,
    I want to extract the data from R/3 to BW by using 2 tables and one Cluster B2.
    Actually my report contains some fields from PA2001, PA2002 and one cluster table B2 (Table ZES). Can I create View by using these 3 tables? If it is not possible how can I get the data from the cluster? Can I create generic datasource by using cluster tables directly?
    In SE11 Transaction the Cluster (table ZES) is showing invalid table.
    I referred some Forums, but no use.
    Can any body tell me procedure to get the data from a cluster (table ZES) ?
    Waiting for you results.
    Thanks and regards
    Rajesh

    HI Siggi,
    Thank you for your reply..
    I am also planning to do FM to get the data. But it is saying that the Cluster table ZES does not exist (ZES is the the standard table, in SE11 also).
    How can I use the Fields from the that table.?
    What can I do now, can you please explain me about this point.
    Waiting for your reply.
    Thanks and Regards
    Rajesh
    Message was edited by:
            rajesh

  • Need how to get the data from the external file in eCatt

    Hi ,
      Could any body suggest how to get the values from the external file(Excel,CSV file,Text file) and pass it as varaiable in ecatt Test script.
    Problem: Need to execute FK01-Vendor creation Transaction with multiple set of data .As per my understanding we could achive through Variants in Testdata set in eCatt .
    But is there any way to store the data in excell file and get the data and pass it to FK01 Test scripts
    Appreciate response on this

    Hi
    See the links they may be useful
    check these link,
    eCATT- An Introduction
    /people/sumeet.kaul/blog/2005/07/26/ecatt-an-introduction
    Creating Test Scripts
    /people/sumeet.kaul/blog/2005/08/10/ecatt-creating-test-scripts
    eCATT Logs
    /people/sapna.modi/blog/2006/04/18/ecatt-logs-part-vi
    eCATT Scripts Creation – TCD Mode
    /people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation-150-tcd-mode-part-ii
    Creation of Test Data Container
    /people/sumeet.kaul/blog/2005/08/24/ecatt-creation-of-test-data-container
    eCATT Scripts Creation - SAPGUI Mode
    /people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation--sapgui-mode-part-iii
    Integrating ECATT & MERCURY QTP Part -1
    /people/community.user/blog/2007/01/02/integrating-ecatt-mercury-qtp-part-1
    Using eCatt to Test Web Dynpro ABAP
    /people/thomas.jung/blog/2006/03/21/using-ecatt-to-test-web-dynpro-abap
    and
    -command reference
    http://help.sap.com/saphelp_nw04/helpdata/en/c6/3c333b40389c46e10000000a114084/content.htm
    /people/sapna.modi/blog/2006/04/10/ecatt--an-introduction-part-i
    http://prasadbabu.blogspot.com
    https://www.sdn.sap.com/sdn/developerareas/was.sdn?page=test_tool_integration_for_sap_e-catt.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/1b/e81c3b84e65e7be10000000a11402f/frameset.htm
    http://www.erpgenie.com/ecatt/index.htm
    hope this helps.
    Reward points for useful Answers
    Regards
    Anji

  • How to get the data from the model node like a table ?

    I want to get the data from the model node  once a record ,and the node  is bound to a internal table in the RFM which I called in the R/3 system. Who can give me some advice to achive it?Thank you!!

    Hi,
    To get the data from the node:
    wdContext.node[your node name].current[node name]_InputElement().get[specific element in the node];
    or you van use:
    wdContext.current[your node]Element().get[your element in the node];
    examples:
    wdContext.nodeZ_Mepro_Po_Detail_Stock_Distri_Input().currentZ_Mepro_Po_Detail_Stock_Distri_InputElement().getUcpd_Flag();
    wdContext.currentT_Delv_ReqsElement().getShelflife();
    regards,

  • How to get the data from multiple tabes into single table

    hi all,
    here i am having 10 data base tables,how to get the data into a single table.
    regards,
    subba reddy

    hi,
    non XI/PI related
    Regards,
    Michal Krawczyk

  • Selecting the data from database and sending to users  using javamail

    how to select the records from database table in oracle and send automatically to users using javamail. I am able to send the txt msg. but dont know how to send the selected table data to users automatically.
    can anyone suggest how to write the steps with database connection to send msgs containing data to different users
    Thank You

    using JDBC..you want to
    1. create the connect
    2. open the connection
    3. query the table for the data
    4. loop through the resultset to retrieve rows of data
    5. do something with the data
    6. email the result
    once you have the data, it is up to you to determine the format to send to the user using JavaMail. It is easiest to send plain text
    here's a site that give code example (for all steps above relating to JDBC):
    http://javaalmanac.com/egs/java.sql/pkg.html

  • How to retrieve the data from Website and Upload it in SAP table?

    Dear ABAPers,
            I want to retrieve the data from website and upload the same in SAP Database Table is that possible.Please help me.It is very Urgent.
    Thanks & Regards,
    Ashok.

    Dear Abhishek,
                  Thanks for your reply.But my requirement is not met.
    If i execute the program it should retrieve the data from particular website.
    Thanks & Regards,
    Ashok.

  • How can i get the data from database & add them as a link

    Hi,
    how can i get a data from a database(DB2) and that data will be having a file so i should make them as a link.i tried it in jsp .
    <%
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
    Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");     
    response.setContentType("text/html");
    Connection conn = null;
    conn = DriverManager.getConnection("jdbc:db2:spintran");
    Statement stmt = conn.createStatement();
    stmt.executeQuery("set current schema tut");
    ResultSet rs = stmt.executeQuery("select * from tutorial");     
    %>
    Type Of the Category : &nbsp&nbsp&nbsp
    <%
         while (rs.next())
         String desc = rs.getString(1);     
         out.println(desc);
    %>
         <A HREF = "<%=desc%>"><%=desc%> </A>
         <%
         %>
    but it is not working.how can i link.
    thank you.

    what is desc? is it the file name ? whats the data type of desc in db? INFILE?
    if desc is just the name of the file, then make sure that such a file exists in the proper folder.only then the link works..
    that is, if desc is 'a.jpg' then a.jpg should be existing in the same folder as your html is.

Maybe you are looking for

  • Crashing on minimize or close

    InDesign crashes every time I minimize or close. So I can't open more than one file at a time : (

  • Dual Color for Text field

    Hi I want to display 2 and more data fields in one line and have created as text field which would appear as Heading on each page (centralised in line) like Name (Age) Keith Roan (40) Jeff Shane (30) Peter Andrews (30) Kamal Chawla (30) Is there a wa

  • How to embed a HTML Page in a Web Template and display it

    Hi All Can you please share ideas how I can embed a HTML page in a web template and how I can make it displayed as a popup when a button is pressed. Also, how do I call a HTML page stored in Portal KM from the press of a button in the web template. Y

  • So where to now? Right after the very first stumbling steps?

    I've used Linux just under three years now (mainly Ubuntu) so I am still very much a newbie. After reading a magazine article about Arch - which statet that, although not a distro for beginners, it was a good starting point for people who want to lea

  • Adobe interactive forms (sorry, other thread closed)

    Hi all, program and form are running. I have tried to get a pdf output. But my dynamic function module get a SYSTEM_ERROR. CALL FUNCTION 'FPCOMP_FORM_END' get a exception 1. CALL FUNCTION 'FPCOMP_CREATE_PDX' get a exception 1 (ADS_ERROR). What means