<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dowloading data from excel sheet in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967907#M397382</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shweta,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you mean upload from an excel sheet into the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can user GUI_UPLOAD, upload the excel into a internal table first with a single field of type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then split the string using the separator CL_ABAP_CHAR_UTILITIES=&amp;gt;horizonal_tab into the fields of your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next if you want only one of the specific rows, read that line using the READ TABLE with INDEX clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Feb 2007 13:55:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-09T13:55:25Z</dc:date>
    <item>
      <title>Dowloading data from excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967905#M397380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me the function module to download the data from excel sheet in to the internal table created in program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And how to download the data from a particular line in the excel sheet into internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 13:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967905#M397380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T13:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dowloading data from excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967906#M397381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;U can use&lt;/P&gt;&lt;P&gt;1.ALSM_EXCEL_TO_INTERNAL_TABLE&lt;/P&gt;&lt;P&gt;2. 'KCD_EXCEL_OLE_TO_INT_CONVERT' FM&lt;/P&gt;&lt;P&gt;to upload data from excel into internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = filename&lt;/P&gt;&lt;P&gt;i_begin_col = 1&lt;/P&gt;&lt;P&gt;i_begin_row = 1&lt;/P&gt;&lt;P&gt;i_end_col = 3&lt;/P&gt;&lt;P&gt;i_end_row = 65535&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;intern = it_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. DATA : l_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : l_index TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : l_start_col TYPE i VALUE '1',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_start_row TYPE i VALUE '1',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_end_col TYPE i VALUE '256',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_end_row TYPE i VALUE '65536'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = p_file&lt;/P&gt;&lt;P&gt;i_begin_col = l_start_col&lt;/P&gt;&lt;P&gt;i_begin_row = l_start_row&lt;/P&gt;&lt;P&gt;i_end_col = l_end_col&lt;/P&gt;&lt;P&gt;i_end_row = l_end_row&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;intern = l_intern&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;inconsistent_parameters = 1&lt;/P&gt;&lt;P&gt;upload_ole = 2&lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/upload-direct-excel.htm" target="test_blank"&gt;http://www.sap-img.com/abap/upload-direct-excel.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/excel_upload_alternative-kcd-excel-ole-to-int-convert.htm" target="test_blank"&gt;http://www.sap-img.com/abap/excel_upload_alternative-kcd-excel-ole-to-int-convert.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/file/file_upexcel.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/file/file_upexcel.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 13:54:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967906#M397381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T13:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dowloading data from excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967907#M397382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shweta,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you mean upload from an excel sheet into the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can user GUI_UPLOAD, upload the excel into a internal table first with a single field of type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then split the string using the separator CL_ABAP_CHAR_UTILITIES=&amp;gt;horizonal_tab into the fields of your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next if you want only one of the specific rows, read that line using the READ TABLE with INDEX clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 13:55:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967907#M397382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T13:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dowloading data from excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967908#M397383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES:
  BEGIN OF ty_upload,
    field1 TYPE c length 12,
    field2 TYPE c length 12,
    field3 TYPE c length 12,
  END OF ty_upload.
  DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.
  DATA wa_upload TYPE ty_upload.
  DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.
  FIELD-SYMBOLS: &amp;lt;wa&amp;gt; type alsmex_tabline.

  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      filename    = filename
      i_begin_col = 1
      i_begin_row = 1
      i_end_col   = 3
      i_end_row   = 65535
    TABLES
      intern      = itab.

  LOOP AT itab ASSIGNING &amp;lt;wa&amp;gt;.
    CASE &amp;lt;wa&amp;gt;-col.
      WHEN '0001'.
        wa_upload-field1 = &amp;lt;wa&amp;gt;-value.
      WHEN '0002'.
        wa_upload-field2 = &amp;lt;wa&amp;gt;-value.
      WHEN '0003'.
        wa_upload-field3 = &amp;lt;wa&amp;gt;-value.
    ENDCASE.
    APPEND wa_upload TO it_upload.
    CLEAR wa_upload.
  ENDLOOP&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/upload-direct-excel.htm" target="test_blank"&gt;http://www.sap-img.com/abap/upload-direct-excel.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Another Program&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  UPLOAD_EXCEL                                                *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp; Upload and excel file into an internal table using the following    *
*&amp;amp; function module: ALSM_EXCEL_TO_INTERNAL_TABLE                       *
*&amp;amp;---------------------------------------------------------------------*
REPORT  UPLOAD_EXCEL no standard page heading.

*Data Declaration
*----------------
data: itab like alsmex_tabline occurs 0 with header line.
* Has the following format:
*             Row number   | Colum Number   |   Value
*             ---------------------------------------
*      i.e.     1                 1             Name1
*               2                 1             Joe

TYPES: Begin of t_record,
    name1 like itab-value,
    name2 like itab-value,
    age   like itab-value,
    End of t_record.
DATA: it_record type standard table of t_record initial size 0,
      wa_record type t_record.
DATA: gd_currentrow type i.

*Selection Screen Declaration
*----------------------------
PARAMETER p_infile like rlgrap-filename.


************************************************************************
*START OF SELECTION
 call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
       exporting
            filename                = p_infile
            i_begin_col             = '1'
            i_begin_row             = '2'  "Do not require headings
            i_end_col               = '14'
            i_end_row               = '31'
       tables
            intern                  = itab
       exceptions
            inconsistent_parameters = 1
            upload_ole              = 2
            others                  = 3.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message e010(zz) with text-001. "Problem uploading Excel Spreadsheet
  endif.

* Sort table by rows and colums
  sort itab by row col.

* Get first row retrieved
  read table itab index 1.

* Set first row retrieved to current row
  gd_currentrow = itab-row.

  loop at itab.
*   Reset values for next row
    if itab-row ne gd_currentrow.
      append wa_record to it_record.
      clear wa_record.
      gd_currentrow = itab-row.
    endif.

    case itab-col.
      when '0001'.                              "First name
        wa_record-name1 = itab-value.
      when '0002'.                              "Surname
        wa_record-name2 = itab-value.
      when '0003'.                              "Age
        wa_record-age   = itab-value.
    endcase.
  endloop.
  append wa_record to it_record.
*!! Excel data is now contained within the internal table IT_RECORD

* Display report data for illustration purposes
  loop at it_record into wa_record.
    write:/     sy-vline,
           (10) wa_record-name1, sy-vline,
           (10) wa_record-name2, sy-vline,
           (10) wa_record-age, sy-vline.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 13:58:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967908#M397383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T13:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dowloading data from excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967909#M397384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the Function module ALSM_EXCEL_TO_INTERNAL_TABLE to read the Excel file into the internal table of type alsmex_tabline. From this internal table you can fill the target internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;  BEGIN OF ty_upload,&lt;/P&gt;&lt;P&gt;    field1 TYPE c length 12,&lt;/P&gt;&lt;P&gt;    field2 TYPE c length 12,&lt;/P&gt;&lt;P&gt;    field3 TYPE c length 12,&lt;/P&gt;&lt;P&gt;  END OF ty_upload.&lt;/P&gt;&lt;P&gt;  DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;  DATA wa_upload TYPE ty_upload.&lt;/P&gt;&lt;P&gt;  DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;wa&amp;gt; type alsmex_tabline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename    = filename&lt;/P&gt;&lt;P&gt;      i_begin_col = 1&lt;/P&gt;&lt;P&gt;      i_begin_row = 1&lt;/P&gt;&lt;P&gt;      i_end_col   = 3&lt;/P&gt;&lt;P&gt;      i_end_row   = 65535&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      intern      = itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT itab ASSIGNING &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;    CASE &amp;lt;wa&amp;gt;-col.&lt;/P&gt;&lt;P&gt;      WHEN '0001'.&lt;/P&gt;&lt;P&gt;        wa_upload-field1 = &amp;lt;wa&amp;gt;-value.&lt;/P&gt;&lt;P&gt;      WHEN '0002'.&lt;/P&gt;&lt;P&gt;        wa_upload-field2 = &amp;lt;wa&amp;gt;-value.&lt;/P&gt;&lt;P&gt;      WHEN '0003'.&lt;/P&gt;&lt;P&gt;        wa_upload-field3 = &amp;lt;wa&amp;gt;-value.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;    APPEND wa_upload TO it_upload.&lt;/P&gt;&lt;P&gt;    CLEAR wa_upload.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 14:01:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967909#M397384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T14:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dowloading data from excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967910#M397385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shweta,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use Function module FAA_FILE_UPLOAD_EXCEL for uploading data from excel sheet. This function module will upload the data in internal table using comma as a field seprator. If you want to change the field separator the copy the function module to Z func module &amp;amp; use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 14:07:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dowloading-data-from-excel-sheet/m-p/1967910#M397385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T14:07:19Z</dc:date>
    </item>
  </channel>
</rss>

