<?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: getting dump in uplading excel sheet in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646643#M609698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Look at the below example&lt;/P&gt;&lt;P&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;&lt;/P&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, 10 Aug 2007 11:09:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-10T11:09:21Z</dc:date>
    <item>
      <title>getting dump in uplading excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646642#M609697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PARAMETERS : P_FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\SALES_EXCEL'.&lt;/P&gt;&lt;P&gt;DATA : ITAB LIKE STANDARD TABLE OF ALSMEX_TABLINE .&lt;/P&gt;&lt;P&gt;DATA : ITAB1 LIKE  ITAB.&lt;/P&gt;&lt;P&gt;*data : itab1 type itab.&lt;/P&gt;&lt;P&gt;&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                      = P_FILE&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                     = 256&lt;/P&gt;&lt;P&gt;    I_END_ROW                     = 256&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    INTERN                        = ITAB&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCONSISTENT_PARAMETERS       = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  UPLOAD_OLE                    = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS                        = 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code is geeting me dump can any one help.............&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 11:03:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646642#M609697</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T11:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: getting dump in uplading excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646643#M609698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Look at the below example&lt;/P&gt;&lt;P&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;&lt;/P&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, 10 Aug 2007 11:09:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646643#M609698</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T11:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: getting dump in uplading excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646644#M609699</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;P&gt;Try using exact filename with extension: 'C:SALES_EXCEL.xls'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out, that the file is not used in your MS excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 11:09:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646644#M609699</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T11:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: getting dump in uplading excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646645#M609700</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;P&gt;This code is not giving me a dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check "'C:\SALES_EXCEL' or C:\SALES_EXCEL.xls'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 11:11:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646645#M609700</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T11:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: getting dump in uplading excel sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646646#M609701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check with your file extension ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;file name would be file.xls .. and also do not open xl file while using program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do not comment Function module exception,if you want to know exact problem,then uncomment Exception,it gives sy-subrc value..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chk this link for a sample program:&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1093932"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For excel file Upload check this link...&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 11:15:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-dump-in-uplading-excel-sheet/m-p/2646646#M609701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T11:15:48Z</dc:date>
    </item>
  </channel>
</rss>

