How to extract data into excel file from more than one internal table

Hi Guys
             I want to extract the data from module pool screen.
             In screen there are two internal tables
                  1. header
                  2. items.
             I want to extract the data as same format looking in the screen.
             With simple Download FM we cannot do this one, because in this we   will display as continuous rows.
<b> But my requirement is saving as table with heading, date, header details</b>
Note that it is not the simple down load . Suggest me with example  coding

Hi Guys,
  I think it depends on which software you will use to see the result.
  If U are using Excel, it's very easy to achieve it.
  1. Define a structure as string, the lenth depend on your need.And use the structure to define a internal table, supposed is as A..
  2. Concatenate the head data using some separator, for ex. a comma; and then add this into A.
  3. The above step's concatenate is depend on your format for request;For ex, you want to place the date at the 4th cell in excel, that means you should put three separator before the date field.
  4 Concatenate the item data into the download table.
  5. Download the table to file.
  6. Display the file, using your defined separator.
Hope this helpful.
Bob

Similar Messages

  • How do I merge multiple Excel files with more than one tab in each file using PowerQuery?

    Hello
    I have 12 Excel (.xlsx) files and each file has three identically named and ordered tabs in them. 
    I know how to merge multiple Excel files in a folder using M (those guides are all over the web) but how do I merge multiple Excel files with multiple (yet identically named and ordered) tabs? Surely it is possible? I just don't know how to do it in M.
    Cheers
    James

    What Laurence says is correct, and probably the best thing to do when the sheets have differing structures. Here is an alternate approach that works well when the sheets all have the same structure.
    When you first open the Excel file from Power Query, you can see its structure in the navigator at the right-hand-side of the screen. If you select the root (which is the filename itself) and click Edit, you'll see all the tabs in the sheet as a single table.
    You can now do filtering based on the Name, Item and Kind values. When you've reduced the set of things down to the sheets you want, select the Data column and say "Remove Other Columns". If the sheets don't have any header rows, you can just click the expand
    icon in the header and you'll be done.
    Otherwise, if the sheets have headers or if some other kind of sheet-level transformation is required against each sheet before doing a merge, you'll have to write some M code manually. In the following example, each sheet has a header row consisting of
    two columns: Foo and Bar. So the only step I need to perform before merging is to promote the first row into a header. This is done via the Table.TransformColumns operation.
    let
        Source = Excel.Workbook(File.Contents("C:\Users\CurtH\Desktop\Test1.xlsx")),
        RemovedOtherColumns = Table.SelectColumns(Source,{"Data"}),
        PromotedHeaders = Table.TransformColumns(RemovedOtherColumns,{{"Data", each Table.PromoteHeaders(_)}}),
        ExpandData = Table.ExpandTableColumn(PromotedHeaders, "Data", {"Foo", "Bar"}, {"Data.Foo", "Data.Bar"})
    in
        ExpandData

  • Can a master data will have loading from more than one data source

    Dear gurus,
          I have a master data object which has every day loading from one particular data source. Now I got a requirement to load data from another data source. If we load data from more than one data source , will there be any problem with data? Will it accept loading from more than one data source.?
    Regards
    Rs

    Hi Ram,
    We can load the data to target morethan one datasource.Thats advantage in BI compare to BW. It will accept loading from more than one datasource.but you have to take care about characteristic and attributes are the same in both datasources like that.
    Regards,
    SVS

  • Need to download JAR files from more than ONE HTTP-server ?

    Hello,
    We have a need to download JAR files for an application, from more than ONE HTTP-server, i.e. any specified HTTP-server in an extremely secure network.
    Does a solution exist for this requirement ? Is it possible to design a solution our selfes for this problem ?
    Best Regards
    Peter

    We have a need to download JAR files for an
    application, from more than ONE
    HTTP-server, That can be done using the extension element
    from within the resources element of the main JNLP.
    http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html#resources
    The extension element should refer to another JNLP
    (on the other site) that refers to the Jars. The jar files
    in any such (foreign) JNLP need to be signed, and the
    JNLP files should declare itself as a <component-desc>.
    For any level of detail on using extensions/components,
    download the spec. mentioned in the second paragraph
    of that section linked above. Unfortunately I can find no
    web browsable form of the information.
    Here is an example though..
    http://www.javasaver.com/testjs/jws/04/glclock.jnlp
    This (sandboxed) screenaver demo comes off my
    javasaver site. It refers to the JOGL API via an
    extension element in the JNLP, that points directly
    to the JOGL site. You might notice the security
    warning that is produced mentions..
    Name:      JOGL
    Publisher: sun microsystems, inc
    Source:    https://jogl.dev.java.net
    ..i.e. any specified HTTP-server in an
    extremely secure network. I do not know about an extremely secure network,
    but if it is OK to launch a normal JNLP for an
    application with a 'main()' from the server, I guess
    it should be OK to launch extensions off it - you
    might need to set up some tests.

  • How to store data into a file from a host VI developed for Compact RIO

    Hi,
    I am new to the CompactRIo.I have developed a VI which runs on the FPGA(CompactRIO) which continuously monitors tha data from a system and i have developed a host VI to read the data and i am successfully getting the data into my computer and i want that data to store into a file.When i use the write to spreadsheet VI for writing into a file.The data is not written into file can anybody tell me why this is happening?

    Hi,
    The last one you said is working when i conected through it is working, whatever files i have  used earlier are there.Thanks  for that but i have few queries please answer me so that i acn proceed in my  project.
    1.As you said to connect to ftp://xx.xx.xx.xx i have seen some extra files along with my files waht are they? waether my data files are stored in flash memory of RT controller?if so, how to clear those files?
    2.Suppose i want to clean up the flash memory of RT contrller i.e suppose i have deployed some file earlier , now i want to cleanup those i dumped into the memory how to do that?
    3.How to disable the Application running on the RT controller when it powers on? i.e. when i switch on the power it should be connected but nothing hould be running on.
    4.I mean at the end of the experiment when i stopped the host VI by pressing stop button weather application running on the RT controller will stop and weather FPGA VI runnibg on that also stop if not how to stop?
    5.Suppose next time when i connect to ftp://xx.xx.xx.xx i dont want to keep earlier files there how to delete them?Because my doubt is if i am using the file name which is same as the prevoius one there is aproblem of appending the new data to the old file.?
    Regards,
    Vishnu

  • Invoice: How to use more than one Internal Table's info in one Table

    Hi ,
    I am doing an invoice, and have the info from internal table wa_itgen showing - Matnr, material description and quantity.
    I want to also invlude the info Unit Price and Total price on the table line, but can't seem to do it.
    I know that someone I must fill an internal table as I did on the Table itself : is_bil_invoice-it_gen INTO wa_ITGEN.
                     ( TYPE IBBIL_INVOICE).
    So now I need to insert:
    IS_BIL_INVOICE-IT_PRICE    INTO      WA_ITPRICE.
    Do I insert Program Lines, or do it via a LOOP.  Obviously it needs to go under the same Table's cells to incluce it.
    I tried a LOOP, Program lines under the CELL of the table where I want it displayed, and even a Second table.
    If I have the first table's info, the page displays under VF03, but as soon as I try to insert the 2nd Table's info, under VF03 the screen just not show anymore.
    Please help - I've started looking at local maps for bridges... yes, to jump from...

    Hi try this,
    in the program lines fetch unit price and total price based on ur invoice number(as u are already in main loop which fetches invoice no material no etc).
    now loop that internal table with condition inv no = current invoice no and item no = item number
    and display those values on a new text field accordingly.
    sample code...
    select vbeln
           posnr
           j_3asize
           FKIMG
           KZWI1
           from vbrp
           into table itab
           where vbeln = GS_IT_GEN-BIL_NUMBER.
    loop at itab into wa where vbeln = GS_IT_GEN-BIL_NUMBER and
                               posnr = GS_IT_GEN-ITM_NUMBER .
    move : wa-j_3asize to v_grid,
           WA-FKIMG TO V_QTY,
           wa-KZWI1 to v_val.
           v_up = v_val / v_qty.
    endloop.---->like this

  • How to read a excel file with more than one worksheet.

    Hi,
    I wanna read a sheet (anyone of it,not the first) in a excel.Who can help me!
    best wishes,
    Grant Chen

    Dear All,
    Thank you all for your reply!
    I modified SAP FM ZALSM_EXCEL_TO_INTERNAL_TABLE.
    I add an IMPORTING parameter 'I_SHEET' 
    which stands for the sequence number of worksheet  in the FM.
    FUNCTION ZALSM_EXCEL_TO_INTERNAL_TABLE .
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(FILENAME) LIKE  RLGRAP-FILENAME
    *"     REFERENCE(I_SHEET) TYPE  I
    *"     VALUE(I_BEGIN_COL) TYPE  I
    *"     VALUE(I_BEGIN_ROW) TYPE  I
    *"     VALUE(I_END_COL) TYPE  I
    *"     VALUE(I_END_ROW) TYPE  I
    *"  TABLES
    *"      INTERN STRUCTURE  ALSMEX_TABLINE
    *"  EXCEPTIONS
    *"      INCONSISTENT_PARAMETERS
    *"      UPLOAD_OLE
    *{   INSERT         EC6K900099                                        1
      DATA: excel_tab     TYPE  ty_t_sender.
      DATA: ld_separator  TYPE  c.
      DATA: application   TYPE  ole2_object,
            workbook      TYPE  ole2_object,
            range         TYPE  ole2_object,
            worksheet     TYPE  ole2_object.
      DATA: h_cell        TYPE  ole2_object,
            h_cell1       TYPE  ole2_object.
      DATA:
        ld_rc             TYPE i.
    *   Rückgabewert der Methode "clipboard_export     "
    * Makro für Fehlerbehandlung der Methods
      DEFINE m_message.
        case sy-subrc.
          when 0.
          when 1.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          when others. raise upload_ole.
        endcase.
      END-OF-DEFINITION.
    * check parameters
      IF i_begin_row > i_end_row. RAISE inconsistent_parameters. ENDIF.
      IF i_begin_col > i_end_col. RAISE inconsistent_parameters. ENDIF.
    * Get TAB-sign for separation of fields
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      ld_separator = cl_abap_char_utilities=>horizontal_tab.
    * open file in Excel
      IF application-header = space OR application-handle = -1.
        CREATE OBJECT application 'Excel.Application'.
        m_message.
      ENDIF.
      CALL METHOD  OF application    'Workbooks' = workbook.
      m_message.
      CALL METHOD  OF workbook 'Open'    EXPORTING #1 = filename.
      m_message.
    *  set property of application 'Visible' = 1.
    *  m_message.
    ********************Modified by Grant 20080717************
      call METHOD of application 'Worksheets' = worksheet
      exporting
        #1 = I_SHEET.
      m_message.
      call method of worksheet 'Activate'.
    *  GET PROPERTY OF  application 'ACTIVESHEET' = worksheet.
      m_message.
    * mark whole spread sheet
      CALL METHOD OF worksheet 'Cells' = h_cell
          EXPORTING #1 = i_begin_row #2 = i_begin_col.
      m_message.
      CALL METHOD OF worksheet 'Cells' = h_cell1
          EXPORTING #1 = i_end_row #2 = i_end_col.
      m_message.
      CALL METHOD  OF worksheet 'RANGE' = range
                     EXPORTING #1 = h_cell #2 = h_cell1.
      m_message.
      CALL METHOD OF range 'SELECT'.
      m_message.
    * copy marked area (whole spread sheet) into Clippboard
      CALL METHOD OF range 'COPY'.
      m_message.
    * read clipboard into ABAP
      CALL METHOD cl_gui_frontend_services=>clipboard_import
        IMPORTING
          data                 = excel_tab
        EXCEPTIONS
          cntl_error           = 1
    *      ERROR_NO_GUI         = 2
    *      NOT_SUPPORTED_BY_GUI = 3
          OTHERS               = 4
      IF sy-subrc <> 0.
         MESSAGE a037(alsmex).
      ENDIF.
      PERFORM separated_to_intern_convert TABLES excel_tab intern
                                          USING  ld_separator.
    * clear clipboard
      REFRESH excel_tab.
      CALL METHOD cl_gui_frontend_services=>clipboard_export
         IMPORTING
            data                 = excel_tab
         CHANGING
            rc                   = ld_rc
         EXCEPTIONS
            cntl_error           = 1
    *       ERROR_NO_GUI         = 2
    *       NOT_SUPPORTED_BY_GUI = 3
            OTHERS               = 4
    * quit Excel and free ABAP Object - unfortunately, this does not kill
    * the Excel process
      CALL METHOD OF application 'QUIT'.
      m_message.
    * >>>>> Begin of change note 575877
    * to kill the Excel process it's necessary to free all used objects
      FREE OBJECT h_cell.       m_message.
      FREE OBJECT h_cell1.      m_message.
      FREE OBJECT range.        m_message.
      FREE OBJECT worksheet.    m_message.
      FREE OBJECT workbook.     m_message.
      FREE OBJECT application.  m_message.
    * <<<<< End of change note 575877
    *}   INSERT
    ENDFUNCTION.
    Edited by: Grant Chen on Jul 17, 2008 7:45 AM
    Edited by: Grant Chen on Jul 17, 2008 7:46 AM

  • How to extract the data into Excel / PDF from SAP

    Hi,
    We have spool number of a report output.
    We want to extract the data into Excel / PDF from SAP directly...
    Plz guide...

    Hi ,
    Please check this [Thread|HOW TO DOWNLOAD SAP OUTPUT TO EXCEL FILE;. Hope your problem will be solved.
    You can check [this also.|http://wiki.sdn.sap.com/wiki/display/sandbox/ToConvertSpoolDataintoPDFandExcelFormatandSenditinto+Mail]
    Thanks,
    Abhijit

  • JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC

    Hi,
    I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
    I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
    Regards
    Kumar

    HI,
    Yes it can be possible ,please see the following links
    JDBC  Receiver with Oracle Stored Procedures
    configuring jdbc adapter with multiple tables
    RFC -> XI -> JDBC Scenario Updating Multiple Tables
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    JDBC Adapter multiple Selects
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
    Regards
    Chilla..

  • Uploading data from excel file to a dynamically created internal table

    Hi,
    I have a requirement where i have to upload data from an excel file into a database table. I would be able to determine the structure of the table only at runtime based on the user input.. so i have created an internal table dynamically.
    Could you please tell me if its possible to upload data from an excel file to the dynamically created internal table using any function modules?
    I thought of doing this by declaring a generic internal table of one field and then uploading the *.csv file into it and then splitting it based on "," and then assigning it to the field symbol referencing the internal table.. but my file length exceeds 132 characters and i'm only able to get data of lenght 132 char's in my internal table ( generic one).
    Could anyone please show me a way around this.
    Thanks in advance,
    Harsha

    Sure, check this out.
    report zrich_0002.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: it_fldcat type lvc_t_fcat,
          wa_it_fldcat type lvc_s_fcat.
    type-pools : abap.
    data: new_table type ref to data,
          new_line  type ref to data.
    data: iflat type table of string.
    data: xflat type string.
      data: irec type table of string with header line.
      data: tabix type sy-tabix.
    data: file type string.
    selection-screen begin of block b1 with frame title text .
    parameters: p_file type  rlgrap-filename default 'c:Test.csv'.
    parameters: p_flds type i.
    selection-screen end of block b1.
    start-of-selection.
    * Add X number of fields to the dynamic itab cataelog
      do p_flds times.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = sy-index.
        wa_it_fldcat-datatype = 'C'.
        wa_it_fldcat-inttype = 'C'.
        wa_it_fldcat-intlen = 10.
        append wa_it_fldcat to it_fldcat .
      enddo.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
      file = p_file.
      call method cl_gui_frontend_services=>gui_upload
        exporting
          filename                = file
        changing
          data_tab                = iflat
        exceptions
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          others                  = 17.
      loop at iflat into xflat.
        clear irec. refresh irec.
        split xflat at ',' into table irec.
        loop at irec.
          tabix = sy-tabix.
          assign component tabix of structure <dyn_wa> to <dyn_field>.
          <dyn_field> = irec.
        endloop.
        append <dyn_wa> to <dyn_table>.
      endloop.
    * Write out data from table.
      loop at <dyn_table> into <dyn_wa>.
        do.
          assign component  sy-index  of structure <dyn_wa> to <dyn_field>.
          if sy-subrc <> 0.
            exit.
          endif.
          if sy-index = 1.
            write:/ <dyn_field>.
          else.
            write: <dyn_field>.
          endif.
        enddo.
      endloop.
    Regards,
    Rich Heilman

  • Unable to write data into excel file when it's close

    Hi,
    I'm facing this problem and it's a bit weird. I'm using the following method to insert data into excel file. But when excel file is close, it unable to write data into the excel sheet. But it was able to write the data into the excel sheet if i open the excel file when running the program.
    Can anyone please tell me what's wrong to the code?
    public int updateLog(String sheet, String no, String cpId, String CatId, String rbtCode, String rbt, String rbtName, String artistName, String price, String rbtFileName, String songId, String msg){
            int result = -1;
            try{
                SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.ENGLISH);
                String actionDate = formatter.format(new Date());
                rbtName = rbtName.replaceAll("'", "''");
                artistName = artistName.replaceAll("'", "");
                String sql = "insert into [Sheet3$] (Code, CpID, CategoryID, RBTCode, RBT, RBTName, ArtistName, Price, RBTFileName, SongID, UploadStatus, FileUploadedDateTime) ";
                sql = sql + " values ('" + no + "', '" + cpId + "', '" + CatId + "', '" + rbtCode + "', '" + rbt + "', '" + rbtName + "', '" + artistName + "', '" + price + "', '" + rbtFileName + "', '" + songId + "', '" + msg + "', '" + actionDate + "')";
                System.out.println(sql);
                log.writeLog(sql);
                result = stmnt.executeUpdate(sql);
            } catch(Exception e){
                e.printStackTrace();
                log.printStackTrace(e);
            return result;
        public int openConnection(){
            int result = -1;
            try{
                Class.forName(dbDriver);
                c = DriverManager.getConnection(conStr + excelFilePath+";ReadOnly=0;");
                stmnt = c.createStatement();
            } catch(Exception e){
                e.printStackTrace();
                log.printStackTrace(e);
                return -1;
            return 1;
        }Thanks

    HI,
    i hv a doubt regarding reading / opening of a
    password protected Excel file using jxl( java ) .
    How to read / open a password protected Excel file
    thro Java (jxl ) program .plz let me know some
    example also .
    Regards,
    Ramesh P
    845935822cross posting !! answered here
    http://forum.java.sun.com/thread.jspa?threadID=710466&messageID=9507085#9507085

  • How to from more than one delivery note - conversion into one invoice

    Dear Experts,
    How to from more than one delivery note - conversion into one invoice?
    Thanks and best regards,
    Wilson Hong

    Dear Wilson Hong,
    Single invoice for multiple deliveries will takes place based on these criterion
    1.If you want single billing document for multiple deliveries these data should be same in all order for all items.
    -> Payer
    -> Inco term
    -> Payment term
    -> Actual GI Date from Delivery
    -> Shipping Condition
    -> Account Assignment Group
    -> Exchange rate (in case of export sale order)
    -> Foreign trade data.
    2.In addition to this you need to maintain proper copy control settings between delivery and invoice.
    Go to VTFL transaction input your delivery type and invoice type then go in to the item level settings here you find field Data VBRK/VBRP maintain this field with routine 3-Single invoice.
    If the above data and settings are exists you can do single invoice for multiple deliveries.
    I hope this will help you,
    Regards,
    Murali.

  • Copy a certain row of data into the next row in a same internal table ??

    HI, guys.
    May i know how to copy a certain row of data into the next row in a same internal table ?? Bcz I plan to update a certain colum of data in the row just now into another value..
    For example:-
    *at first...
    ebeln1   ebelp1   xblnr1
    ebeln2   ebelp2   xblnr2
    ebeln3   ebelp3   xblnr3
    *after that, become...
    ebeln1   ebelp1   xblnr1
    ebeln2   ebelp2   xblnr2
    ebeln2   ebelp2   xblnr4
    ebeln2   ebelp2   xblnr5
    ebeln3   ebelp3   xblnr3
    Thanks in advance.

    hi,
    If you have this kind of requirement then you must be having 2 internal tables ,one existing data and 2nd from which you have to insert the records into 1st table.
    so in this case,
    loop at itab1.
      v_index = sy-tabix.
      loop at itab2 into wa where pri_key = itab1-pri_key.
      v_index = v_index + 1.
      insert  wa into itab index v_index.
      endloop.
    endloop.
    Using this code ,your data records similar to your 1st tables primary key records will get inserted into table.

  • Reg: how to join more than one cluster table into one

    Hi gurus
    How to join more than one cluster table into one
    amk

    Hi,
    You cannot join cluster tables
    Best way is to select from the header table and then select from the item table table using for all entries of header table.
    regards,
    Advait

  • How to load an infocube from more than one source system?

    HI all,
    Can u please tell me how to load an info cube from more than one source sytem?

    Hi,
    same confiig is required for one or more source system. (From Data source to update rule, obviously cube remains the same).
    Its the infopackage execution which loads the data from different source system.
    Regards,
    Nawanit

Maybe you are looking for

  • Downgrading Windows 8.1 pro back to windows 8.1 regular

    okay so my friend sent me a code for Windows 8.1 pro (I already had windows 8.1 but I thought I'd use it so I could try out hyper-v) and it all worked perfectly, apart from the fact that the code was only an activator code and now I need to enter ano

  • Can i use multiple AppleID's with one iCloud Account

    Our family stores our purchases in one huge library.  We each log into our accounts separately (e.g. someone uses an iTunes gift card, someone else uses a credit card, etc.) to purchase music.  Each of us can include other's purchases in our play lis

  • FCP crashes, and opening and saving projects take too much time

    Since my upgrade to FCP 5.0.4 I’m having trouble on several aspects of FCP. I am using an Xserve raid storage, connected via fiberchannel to an Xserve with 10.4.4. The editing computers are connected via fiberchannel and Xsan to the central storage.

  • Could we have an eyedropper tool to select precise color to do HSL adjustments on?

    HSL is wonderful tool, I like it very much but would love to be able to precisely select a certain color with it's current HSL that is in my image and  with eyedropper tool and then only those pixels with that same color could be as custom color and

  • Cant change country!

    I cant change country in itunes, clicking the change country icon displays a menu containing countrys but when i select one it goes straight back to the US-store! Please help me...