How to import data from all excel worksheet ?

hi
I want to import data from excel worksheet. There is a fm ALSM_EXCEL_TO_INTERNAL_TABLE but it read data only from "actual" sheet. How can I   
read data from all exel spread sheets ?
krzys

Hi,
check this code, this is gathered from one of the thread.
report zole123.
INCLUDE ole2incl.
DATA:  count TYPE i,
       application TYPE ole2_object,
       workbook TYPE ole2_object,
       excel     TYPE ole2_object,
       sheet TYPE ole2_object,
       cells TYPE ole2_object.
CONSTANTS: row_max TYPE i VALUE 256.
DATA index TYPE i.
DATA: BEGIN OF itab1 OCCURS 0, first_name(10), END OF itab1.
DATA: BEGIN OF itab2 OCCURS 0, last_name(10), END OF itab2.
DATA: BEGIN OF itab3 OCCURS 0, place(50), END OF itab3.
*START-OF-SELECTION
START-OF-SELECTION.
  APPEND: 'name1' TO itab1, 'surname1' TO itab2,
                              'worli' TO itab3,
            'nam2' TO itab1, 'surname2' TO itab2,
                              'chowpatty' TO itab3,
           'name3' TO itab1, 'surname3' TO itab2,
                              'versova' TO itab3,
            'name4' TO itab1, 'surname4' TO itab2,
                              'grant road' TO itab3,
            'name5' TO itab1, 'surname5' TO itab2,
                              'gaon' TO itab3,
            'name6' TO itab1, 'surname6' TO itab2,
                              'mahim' TO itab3.
CREATE OBJECT application 'excel.application'.
SET PROPERTY OF application 'visible' = 1.
CALL METHOD OF application 'Workbooks' = workbook.
CALL METHOD OF workbook 'Add'.
  CREATE OBJECT excel 'EXCEL.APPLICATION'.
  IF sy-subrc NE 0.
    WRITE: / 'No EXCEL creation possible'.
    STOP.
  ENDIF.
  SET PROPERTY OF excel 'DisplayAlerts' = 0.
  CALL METHOD OF excel 'WORKBOOKS' = workbook .
  SET PROPERTY OF excel 'VISIBLE' = 1.
Create worksheet
  SET PROPERTY OF excel 'SheetsInNewWorkbook' = 1.
  CALL METHOD OF workbook 'ADD'.
DO 3 TIMES.
    IF sy-index GT 1.
      CALL METHOD OF excel 'WORKSHEETS' = sheet.
      CALL METHOD OF sheet 'ADD'.
      FREE OBJECT sheet.
    ENDIF.
  ENDDO.
  count = 1.
  DO 3 TIMES.
    CALL METHOD OF excel 'WORKSHEETS' = sheet
      EXPORTING
        #1 = count.
   perform get_sheet_name using scnt sname.
    CASE count.
      WHEN '1'.
        SET PROPERTY OF sheet 'NAME' = 'firstName'.
        CALL METHOD OF sheet 'ACTIVATE'.
        " add header here
        LOOP AT itab1.
          index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name " for headings change the - 1 to + 1 to accomodate 2 extra lines
          CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
          SET PROPERTY OF cells 'Formula' = itab1-first_name.
          SET PROPERTY OF cells 'Value' = itab1-first_name.
        ENDLOOP.
      WHEN '2'.
        SET PROPERTY OF sheet 'NAME' = 'LastName'.
        CALL METHOD OF sheet 'ACTIVATE'.
" add header here
        LOOP AT itab2.
          index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name " for headings change the - 1 to + 1 to accomodate 2 extra lines
          CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
          SET PROPERTY OF cells 'Formula' = itab2-last_name.
          SET PROPERTY OF cells 'Value' = itab2-last_name.
        ENDLOOP.
      WHEN '3'.
        SET PROPERTY OF sheet 'NAME' = 'place'.
        CALL METHOD OF sheet 'ACTIVATE'.
" add header here
        LOOP AT itab3.
          index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name " for headings change the - 1 to + 1 to accomodate 2 extra lines
          CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
          SET PROPERTY OF cells 'Formula' = itab3-place.
          SET PROPERTY OF cells 'Value' = itab3-place.
        ENDLOOP.
    ENDCASE.
    count = count + 1.
  ENDDO.
Save excel speadsheet to particular filename
  GET PROPERTY OF excel 'ActiveSheet' = sheet.
  CALL METHOD OF sheet 'SaveAs'
                   EXPORTING #1 = 'c:\temp\exceldoc1.xls'     "filename
                             #2 = 1.                          "fileFormat
Note: to make headings, change the -1 to +1 where specified in the above code and add the following where i have mentioned to add it
index = row_max * ( sy-tabix - 1 ) + 1.
CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
SET PROPERTY OF cells 'value' = header1.
Reward for helpful answers
Thanks
Naveen khan

Similar Messages

  • How to import data from excel or csv files to Oracle table

    hello everybody,
    I am new here and new in Oracle. I would like to know the steps how to import data from excel or csv files to Oracle table.
    Let say I already have table inside the Oracle. Then my user give me the sets of data inside the Excel Worksheet.
    So, how can I import the excel data into Oracle table.
    Thank you in advance.
    cheers,
    shima

    Even easier. Download JDeveloper 11G from this site.
    Set up the database connection, right click on the table, select Import->Excel and specify your file to load it. On the import pop-up, you must view and update each tab indicating Columns, Data Types, and DML.
    Columns -- move the selected columns that you want to load to the box on the right
    Data Types -- select column name from second column to which the data for each column of the import file should load
    DML -- click this tab to generate the INSERT SQL
    Once done click 'Insert'

  • I need how to load data from MS Excel(csv format) to NW Excel

    Hi,
    I am doing Migration project from SAP MS to NW Manually.
    I need how to load data from MS excel (csv format) to NW excel .
    For example 2008 budget data.
    Could you please help me in this.
    Thanks and Regards
    Krishna

    Hi,
    You need to create a transformation file and a conversion file if required. First upload the excel (csv) file into BPC using Manage Data and Upload File option.
    Create the transformation file (refer to the sap help  on how to define a transformation file). You need to specify the mapping correctly and include all your application dimensions and map them to appropriate columns of the flat file.
    Before running the import package, do validate the data in the flat file you uploaded into BPC with the transformation file you created.
    Thanks,
    Sreeni

  • Importing data from Microsoft excel file to Oracle Database with Multiple Data Tables. Need expert advice and guidance

    I posted a query on Importing data from Microsoft Excel to Oracle Database (Multiple Data Tables). I got some answer and reference from the forum.
    I presented to my Oracle consultant and representative from Oracle Malaysia. They said impossible. I do not believe what they said. I do believe can be done.
    Can someone help or direct me to an expert that can help me on this

    e90f478a-c529-4c48-b189-51eebeaed477 wrote:
    I posted a query on Importing data from Microsoft Excel to Oracle Database (Multiple Data Tables). I got some answer and reference from the forum.
    I presented to my Oracle consultant and representative from Oracle Malaysia. They said impossible. I do not believe what they said. I do believe can be done.
    Can someone help or direct me to an expert that can help me on this
    We don't know the "query on Importing data from Microsoft Excel to Oracle Database (Multiple Data Tables). "
    We don't know where you posted said query.
    We don't know what "some answer and reference" you received "from the forum."
    We don't know what it was that your "Oracle consultant and representative from Oracle Malaysia" said was "impossible".
    So on what basis are we supposed to "help or direct" to "to an expert that can help "?

  • How to import data from CSV to TCode COR6N

    Hi friends,
    Please help me. I don't know how to import data from CSV file to TCode COR6N. (time ticket for production order)
    I used function: BAPI_PRODORDCONF_CREATE_TT to fill information into TCode COR6n, but it thrown error: "Orders of the order type ZP01 cannot be confirmed". ZP01 is my Order Type.
    Thanks in advance.
    Nguyen Phuoc Toan.

    You can use the LSMW tool to do this.
    The details of LSMW BAPI method is as follows :-
    Business Object:- BUS2116
    Method:-CREATEPREDEFTIMETICKETMULTIPLE
    Message Type:- PPCC2PRETTICKET
    Basic Type:- PPCC2PRETTICKET01
    Regards
    Dhirendra

  • How to import data from CSV to TCode COR1?

    Hi SAP PP guru,
    How to import data from CSV file to TCode COR1?
    Thanks in advance,
    Nguyen Phuoc Toan.

    Nguyen,
    You have not yet confirmed what your requirement is?
    You can take the help of ABAP person to understand what BDC or LSMW is about, basically this is a tool provided by SAP that would enable you to record a transaction process and you can use the code to perform the transaction in mass. [Help on LSMW|http://help.sap.com/erp2005_ehp_04/helpdata/EN/ad/2d54a41d7011d2b42e006094b944c8/content.htm]
    Regards,
    Prasobh

  • How to import data from a text file into a table

    Hello,
    I need help with importing data from a .csv file with comma delimiter into a table.
    I've been struggling to figure out how to use the "Import from Files" wizard in Oracle 10g web-base Enterprise Manager.
    I have not been able to find a simple instruction on how to use the Wizard.
    I have looked at the Oracle Database Utilities - Overview of Oracle Data Pump and the Help on the "Import: Files" page.
    Neither one gave me enough instruction to be able to do the import successfully.
    Using the "Import from file" wizard, I created a Directory Object using the Create Directory Object button. I Copied the file from which i needed to import the data into the Operating System Directory i had defined in the Create Directory Object page. I chose "Entire files" for the Import type.
    Step 1 of 4 is the "Import:Re-Mapping" page, I have no idea what i need to do on this page. All i know i am not tying to import data that was in one schema into a different schema and I am not importing data that was in one tablespace into a different tablespace and i am not R-Mapping datafiles either. I am importing data from a csv file.
    For step 2 of 4, "Import:Options" page, I selected the same directory object i had created.
    For step 3 of 4, I entered a job name and a description and selected Start Immediately option.
    What i noticed going through the wizard, the wizard never asked into which table do i want to import the data.
    I submitted the job and I got ORA-31619 invalid dump file error.
    I was sure that the wizard was going to fail when it never asked me into which table do i want to import the data.
    I tried to use the "imp" utility in command-line window.
    After I entered (imp), i was prompted for the username and the password and then the buffer size as soon as i entered the min buffer size I got the following error and the import was terminated:
    C:\>imp
    Import: Release 10.1.0.2.0 - Production on Fri Jul 9 12:56:11 2004
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Username: user1
    Password:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Import file: EXPDAT.DMP > c:\securParms\securParms.csv
    Enter insert buffer size (minimum is 8192) 30720> 8192
    IMP-00037: Character set marker unknown
    IMP-00000: Import terminated unsuccessfully
    Please show me the easiest way to import a text file into a table. How complex could it be to do a simple import into a table using a text file?
    We are testing our application against both an Oracle database and a MSSQLServer 2000 database.
    I was able to import the data into a table in MSSQLServer database and I can say that anybody with no experience could easily do an export/import in MSSQLServer 2000.
    I appreciate if someone could show me how to the import from a file into a table!
    Thanks,
    Mitra

    >
    I can say that anybody with
    no experience could easily do an export/import in
    MSSQLServer 2000.
    Anybody with no experience should not mess up my Oracle Databases !

  • How to read data from the excel file using java code.

    Hi to all,
    I am using below code to getting the data from the excel file but I can't get the corresponding data from the specific file. can anyone give me the correct code to do that... I will waiting for your usefull reply......
    advance thanks....
    import java.io.*;
    import java.sql.*;
        public class sample{
                 public static void main(String[] args){
                      Connection connection = null;
                          try{
                               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                               Connection con = DriverManager.getConnection( "jdbc:odbc:Mydsn","","" );
                               Statement st = con.createStatement();
                               ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );
                               System.out.println("sample:"+rs);
                                  ResultSetMetaData rsmd = rs.getMetaData();
                                  System.out.println("samplersd:"+rsmd);
                               int numberOfColumns = rsmd.getColumnCount();
                                  System.out.println("numberOfColumns:"+numberOfColumns);
                                   while (rs.next()) {
                                            System.out.println("sample1:"+rs);
                                            for (int i = 1; i <= numberOfColumns; i++) {
                                                 if (i > 1) System.out.print(", ");
                                                 String columnValue = rs.getString(i);
                                                 System.out.print(columnValue);
                                            System.out.println("");
                                       st.close();
                                       con.close();
                                      } catch(Exception ex) {
                                           System.err.print("Exception: ");
                                           System.err.println(ex.getMessage());
                        }

    1: What is the name of the excel sheet?
    2: What is printed in this program? null ? anything?
    error?Excel file name is "sample.xls" I set excel file connectivity in my JDBC driver(DSN). Here in my program I am not giving that excel file name. I am giving only that excel sheet name. that is followed
    ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );The output of this program is given bellow.
    sample:sun.jdbc.odbc.JdbcOdbcResultSet@1b67f74
    samplersd:sun.jdbc.odbc.JdbcOdbcResultSetMetaData@530daa
    numberOfColumns:2

  • Import Data from MS Excel

    How can I import data from excel sheet to an Oracle database. My OS - WinXP Professional and Database 9.2.0.1.0.

    If you're willing to upgrade to 9.2.0.3, you may want to take a look at Oracle HTML DB, a new feature in the 10g Database? You can find information about it here:
    http://otn.oracle.com/products/database/htmldb
    One of its features is a wizard for importing spreadsheet data. You can see how this works in this Quicktour:
    http://otn.oracle.com/products/database/htmldb/viewlets/htmldb_quicktour_viewlet.html
    You can also try it yourself using this Oracle By Example:
    http://otn.oracle.com/obe/obe10gdb/develop/htmldb/htmldb.htm
    Sergio

  • How to import date from pl/sql

    I m using 9i database and form 6i windows 2003
    I created a form and using this code to get the backup, resulting I get a .DMP file.
    I want to import data from this DMP file through pl/slq .. how can I ?
    I want that only data should be import from dmp file.
    my export code :-+_
    Declare
    user_name varchar2(50) := Get_Application_Property(username);
    pass varchar2(50) := Get_Application_Property(password);
    Cstring varchar2(50) := Get_Application_Property(connect_string);
    str varchar2(100);
    Begin
    str :='Exp userID='||user_name||'/'||pass||'@'||Cstring||' rows=y file='||:Path;
    :EXP_BLK.PS:=PASS;
    :EXP_BLK.UR:=USER_NAME;
    :EXP_BLK.ST:=CSTRING;
         :Status := 'Backup Start.....Please Wait.......';
         Synchronize;
         Host(Str);
    Bell;
    bell;
         :Status := 'Backup Sucessfully Completed....';
         Synchronize;
    End;

    First of all this is not Forms forum, this is PL/SQL forum.
    Next, your question and the content inside your post confused me. We are not getting one thing - where do you want to import date data type?
    please explain.
    Regards.
    Satyaki De.

  • How to retrieve data from an Excel file which is located on server

    hi everybody,
                    I am using SAP NWDS 2004s .     
                I have done an application on how to export the table data into an Excel .
    Now i want to get the data from an Excel file which is located in server and display that data which is in excel in a View for example a Sample view in Webdynpro  .
    In Sample view i took a uielement textview to display the data ....   
    can any one help how to procced further
    Thanks in advance
    Madhavi

    Options to read Excel data to WebDynpro context
    Reading Excel Sheet from Java without using any Framework
    Reading Multiple Sheets of Excel Sheet from Java
    Few Threads
    How to Display the content of Excel file into Webdynpro Table
    Is it possible to upload data from excel file(.xls)
    Re: How to export the data as integer into excel sheet?
    regards
       Vinod

  • Help! How to read data from an Excel file?

    Hi,
    I need to read data from an Excel file that may contain more then one table in a sheet. How can I read them?
    I would be eternally grateful to anyone who can give me any information.

    Did you try POI from Apache?
    http://jakarta.apache.org/poi/index.html

  • How to read data from a excel and HTML file

    Hi
        I am writing an 2D-array of string into Excel/HTML file using Report generation.
        Can anybody tell me how to retrieve back the written data from the same files again and view in array format.
    Thanks & regards
    Visuman 
    Solved!
    Go to Solution.

    you can use activex to read the data from the excel fileback in the array format...go through this vi...may b this will help you.........
    Attachments:
    Read Excel-1.vi ‏32 KB

  • How to import data from CSV file with columns separated by semicolon?

    I migrate database from MS SQL 2008 to ORACLE 11g
    I export data to CSV file from MS SQL
    then I try to import it to Oracle
    several tables goes fine using Import data option in the SQL Developer
    Standard CSV files with data separated by comma were imported.
    chars, date (with format string), and integer data are imported via import wizard without problems
    the problems were when I try to import table with noninteger numbers with modal part separated by comma not by dot
    comma is the standard separator for columns in CSV file
    so I must change the standard separator to semicolon
    then the import wizard have problem to correct recognize the columns data because it use only standard CSV comma separator :-/
    In SQL Developer 1.5.3 Tools -> Preferences -> Migration -> Data Move Options
    I change "End of Column Delimiter" to ; but it doens't work
    Is this possible to change the standard column separator for import data wizzard in SQL Developer 1.5.3?
    Or maybe someone know how to import data in SQL Developer 1.5.3 from CSV when CSV colunn separator is set to semicolon?

    A new preference has been added to customize the import delimiter in main code line. This should be available as part of future release.

  • HT1296 How to IMPORT data from iphone to pc without icloud or itunes?

    I don't understand how many article I have read and every one is talking about "how to EXPORT data from iDevice to pc but no article is available about "how to IMPORT data (Music, Videos or office files) to iDevice without using icloud or itunes?" can somebody have the answer???

    Well I wonder why that is?  Very simple answer, because YOU CAN'T!

Maybe you are looking for