<?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: Problem in reading excel file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473442#M1253323</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dinesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_file                       "File name
                i_begin_col             = begcol                   "Reading excel  from column
                i_begin_row             = begrow                 "Reading excel  from Row
                i_end_col               = endcol                    "Reading excel  to end column
                i_end_row               = endrow                  "Reading excel  to end row
           TABLES 
                intern                  = iexcel
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Apr 2009 13:52:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-15T13:52:29Z</dc:date>
    <item>
      <title>Problem in reading excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473438#M1253319</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;I have a requirement to read records from an excel to an internal table.I am using FM&lt;/P&gt;&lt;P&gt;KCD_EXCEL_OLE_TO_INT_CONVERT  to read excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem arises when the program comes across a cell which contains some formulae assigned to it.&lt;/P&gt;&lt;P&gt;The FM does not read the value in the specified cell  and throws a runtime-error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards &lt;/P&gt;&lt;P&gt; Dinesh behera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 13:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473438#M1253319</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T13:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in reading excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473439#M1253320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use the following logic to get excel data into internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

 DATA: l_filename LIKE rlgrap-filename.
  DATA: l_mask(80) TYPE c.
  l_mask =  ',All Files (*.*),*.*.'.
  CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
            def_path         = 'C:\'
            mask             = l_mask
            title            = 'Choose Input File'
       IMPORTING
            filename         = l_filename
       EXCEPTIONS
            inv_winsys       = 01
            no_batch         = 02
            selection_cancel = 03
            selection_error  = 04.
  IF sy-subrc = 0.
    p_file = l_filename.
  ENDIF.



DO.
    DESCRIBE TABLE p_table LINES vline.
    vline = vline * count.
    IF vline = vlimit.
      CLEAR: iexcel, iexcel[].
      begrow = vline + 1.
      endrow = begrow + 9998.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_file
                i_begin_col             = begcol
                i_begin_row             = begrow
                i_end_col               = endcol
                i_end_row               = endrow
           TABLES
                intern                  = iexcel
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc &amp;lt;&amp;gt; 0.
        RAISE error_uploading.
        EXIT.
      ELSE.
        SORT iexcel BY row col.
        count = count + 1.
        LOOP AT iexcel.
          MOVE : iexcel-col TO vf_index.
          ASSIGN COMPONENT vf_index OF STRUCTURE p_table TO &amp;lt;fs&amp;gt;.
          MOVE : iexcel-value TO &amp;lt;fs&amp;gt;.
          AT END OF row.
            APPEND p_table.
            CLEAR p_table.
          ENDAT.
        ENDLOOP.
      ENDIF.
      vlimit = sy-index * 9999.
    ELSE.
      EXIT.
    ENDIF.
  ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 13:46:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473439#M1253320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T13:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in reading excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473440#M1253321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Try using the FM  'ALSM_EXCEL_TO_INTERNAL_TABLE'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 13:47:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473440#M1253321</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T13:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in reading excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473441#M1253322</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;It is reading the forumal cells also for me, but i have used the forumula is for 'SUM'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 13:50:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473441#M1253322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T13:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in reading excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473442#M1253323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dinesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_file                       "File name
                i_begin_col             = begcol                   "Reading excel  from column
                i_begin_row             = begrow                 "Reading excel  from Row
                i_end_col               = endcol                    "Reading excel  to end column
                i_end_row               = endrow                  "Reading excel  to end row
           TABLES 
                intern                  = iexcel
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 13:52:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473442#M1253323</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T13:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in reading excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473443#M1253324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try FM TEXT_CONVERT_XLS_TO_SAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-RJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 13:53:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473443#M1253324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T13:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in reading excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473444#M1253325</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 this one.&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                = v_file&lt;/P&gt;&lt;P&gt;      i_begin_col             = 1&lt;/P&gt;&lt;P&gt;      i_begin_row             = 2&lt;/P&gt;&lt;P&gt;      i_end_col               = 11&lt;/P&gt;&lt;P&gt;      i_end_row               = 10&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      intern                  = it_excel&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;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;*looping the table&lt;/P&gt;&lt;P&gt;  LOOP AT it_excel INTO wa_excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*coloum wise diffrensiate the internal table data&lt;/P&gt;&lt;P&gt;    CASE wa_excel-col.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0001'.&lt;/P&gt;&lt;P&gt;        wa_input-tcode = wa_excel-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0002'.&lt;/P&gt;&lt;P&gt;        wa_input-vendor = wa_excel-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0003'.&lt;/P&gt;&lt;P&gt;        MOVE: wa_excel-value TO wa_input-inv_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0004'.&lt;/P&gt;&lt;P&gt;        MOVE: wa_excel-value TO wa_input-inv_no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0005'.&lt;/P&gt;&lt;P&gt;        MOVE: wa_excel-value TO wa_input-post_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0006'.&lt;/P&gt;&lt;P&gt;        MOVE: wa_excel-value TO wa_input-comp_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0007'.&lt;/P&gt;&lt;P&gt;        MOVE: wa_excel-value TO wa_input-acc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0008'.&lt;/P&gt;&lt;P&gt;        MOVE: wa_excel-value TO wa_input-cost_center.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0009'.&lt;/P&gt;&lt;P&gt;        MOVE: wa_excel-value TO wa_input-amt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN '0010'.&lt;/P&gt;&lt;P&gt;        MOVE: wa_excel-value TO wa_input-int_ord.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*At end of every row append the excel data into table it_data&lt;/P&gt;&lt;P&gt;    AT END OF row.&lt;/P&gt;&lt;P&gt;      APPEND wa_input TO it_input.&lt;/P&gt;&lt;P&gt;      CLEAR wa_input.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 13:56:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-reading-excel-file/m-p/5473444#M1253325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T13:56:34Z</dc:date>
    </item>
  </channel>
</rss>

