Skip to Content
author's profile photo Former Member
Former Member

Uploading multiple excel sheets

Dear All,

We are having 4 different excel sheets where data is stored regarding the quantity of laptops, desktops, printers & xerox machines. This data is to be loaded into the SAP tables with Co Code & BA Code as primary key which is there available in excel sheets.

Plz help me in code to upload all the 4 files in SAP tables based on a combination of CO Code & BA Code.

The selection screen will have 4 fields to specify the path of all the 4 excel sheets & all the fields are obligatory.

Thanks & Reg,

Nishant

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 20, 2006 at 04:38 AM

    Hai Nishu,

    The Help documentation (Desktop Office Integration (BC-CI)--> Spreadsheet interface) is quite helpfull.

    Program <b>SAPRDEMO_TABLES_IN_EXCEL</b> uses some of the methods as described in the SAPHelp. You can get a pretty good idea of how to work with it.

    Regards,

    Srikanth.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 20, 2006 at 04:34 AM

    Hi Nishu,

    As suggested yesterday..

    you can do like this..

    data itab1 like table of <tablename> with header line.

    loop at itab.
     move-corresponding itab to itab1.
     append itab1.
    Endloop.
    INSERT <tablename> from TABLE itab1.

    here itab is the table built from the excel..

    if you stil have problem in getting the soln..reply

    regards

    satesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sateeh,

      I got your point. I need to call

      form table_excel (As many times as I per sheets... Suppose I have 4 excel sheets in excel file I need to call it 4 times...)

      But here my query is, Before calling

      form table_excel

      We need to set active sheet in excel right....Other wise It will pick data from the same sheet.... How can we active sheet...

      sheet 1. Active form table_excel

      sheet 2. Active form table_excel

      sheet 3. Active form table_excel

      sheet 4. Active form table_excel

      How can we do this???? Please help me

      Rayudu

  • author's profile photo Former Member
    Former Member
    Posted on Apr 20, 2006 at 04:41 AM

    hi

    good

    if you want to upload the data into the SAP tables than you can use the LSMW to do the same.

    thanks

    mrutyunj

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 20, 2006 at 04:42 AM

    Nishu,

    Use the cl_gui_frontend_services=>file_open_dialog to get the file names and then GUI_UPLOAD to upload all the files into 4 internal tables.

    If all 4 internal tables have the same structure you can simply use APPEND LINE OF ITAB1 TO MAIN_TAB to get data into one table.

    Then you can SORT it by Co Code and BA Code and process the data.

    Regards,

    Ravi

    note : Please mark the helpful answers

    Add comment
    10|10000 characters needed characters exceeded