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

How to upload data from multiple sheets of excel file

Hi,

I want to upload data from multiple sheets of an excel file and get the data in different internal tables ( one internal table per ever sheet ).

I know how to read data from excel file with single sheet.

Any clue on how to do the same for a file with multiple sheets is highly appreciated.

Thanks,

Ajay

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jul 14, 2011 at 07:16 AM

    Hi Ajay,

    You can use FILE_UPLOAD ui element. For multiple files use that may file upload ui elements.

    DATA : conv TYPE REF TO CL_ABAP_CONV_IN_CE.
     
    * Creates a Conversion Instance
    CALL METHOD CL_ABAP_CONV_IN_CE=>CREATE
    EXPORTING
    INPUT = <variable having the xstring data>
    ENCODING = 'UTF-8'
    REPLACEMENT = '?'
    IGNORE_CERR = ABAP_TRUE
    RECEIVING
    CONV = conv.
     
    conv2->READ( importing data =<string data> ).
    SPLIT <string data> AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE <int table>.
     
    LOOP AT <int_table> ASSIGNING <WA_TABLE>.
    * splits string on basis of tabs
    SPLIT <wa_TABLE> AT ',' INTO
    str_itab-field1 str_itab-field2 str_itab-field3.
    APPEND STR_ITAB TO ITAB.
    ENDLOOP.                                     // now itab contains the data of csv file.

    Cheers,

    Kris.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 14, 2011 at 07:21 AM

    Hi.,

    Check this wiki: http://wiki.sdn.sap.com/wiki/display/Snippets/ReadmultiplesheetsofanExcelfileintoSAPthroughABAP

    hope this helps u.,

    Thanks & Regards,

    Kiran

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.