<?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: read excel file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245633#M774667</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sumesh,&lt;/P&gt;&lt;P&gt;try the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are also a couple of alternatives which use fucntion modules &amp;#145;KCD_EXCEL_OLE_TO_INT_CONVERT&amp;#146;&lt;/P&gt;&lt;P&gt;and &amp;#145;ALSM_EXCEL_TO_INTERNAL_TABLE&amp;#146; but the method below is by far the simplest method to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;..&lt;/P&gt;&lt;P&gt;*: Description :&lt;/P&gt;&lt;P&gt;*: &amp;#151;&amp;#151;&amp;#151;&amp;#150; :&lt;/P&gt;&lt;P&gt;*: This is a simple example program to get data from an excel :&lt;/P&gt;&lt;P&gt;*: file and store it in an internal table. :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: Author : &lt;A href="https://community.sap.com/www.sapdev.co.uk" target="test_blank"&gt;www.sapdev.co.uk&lt;/A&gt;, based on code from Jayanta :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: SAP Version : 4.7 :&lt;/P&gt;&lt;P&gt;*:&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;:&lt;/P&gt;&lt;P&gt;REPORT zupload_excel_to_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: truxs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_file TYPE rlgrap-filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_datatab,&lt;/P&gt;&lt;P&gt;col1(30) TYPE c,&lt;/P&gt;&lt;P&gt;col2(30) TYPE c,&lt;/P&gt;&lt;P&gt;col3(30) TYPE c,&lt;/P&gt;&lt;P&gt;END OF t_datatab.&lt;/P&gt;&lt;P&gt;DATA: it_datatab type standard table of t_datatab,&lt;/P&gt;&lt;P&gt;wa_datatab type t_datatab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_raw TYPE truxs_t_text_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;At selection screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;#145;F4_FILENAME&amp;#146;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;field_name = &amp;#145;P_FILE&amp;#146;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;file_name = p_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;#145;TEXT_CONVERT_XLS_TO_SAP&amp;#146;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_FIELD_SEPERATOR =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;i_line_header = &amp;#145;X&amp;#146;&lt;/P&gt;&lt;P&gt;i_tab_raw_data = it_raw &amp;#148; WORK TABLE&lt;/P&gt;&lt;P&gt;i_filename = p_file&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;i_tab_converted_data = it_datatab[] &amp;#147;ACTUAL DATA&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;conversion_failed = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&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;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;LOOP AT it_datatab INTO wa_datatab.&lt;/P&gt;&lt;P&gt;WRITE:/ wa_datatab-col1,&lt;/P&gt;&lt;P&gt;wa_datatab-col2,&lt;/P&gt;&lt;P&gt;wa_datatab-col3.&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Shilpi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Dec 2007 10:20:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-31T10:20:00Z</dc:date>
    <item>
      <title>read excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245627#M774661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i need to read an excel file into an internal table. i already used gui_download and ALSM_EXCEL_TO_INTERNAL_TABLE but my problem is not solved as my excel file has 12 field, out of which three fields are for comments and therefore of variable length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Th above two mentioned FM can read per line onle 4096 characters but in my case it can be more than that also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me if you have any solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Dec 2007 10:00:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245627#M774661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-31T10:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: read excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245628#M774662</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;Did you tried this FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEXT_CONVERT_XLS_TO_SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Rk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Dec 2007 10:03:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245628#M774662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-31T10:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: read excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245629#M774663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if you copy the code of ALSM_EXCEL_TO_INTERNAL_TABLE into your own program, it's only a limitted number of lines, and change the definition of your data lines to the suze of your excel sheet lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Dec 2007 10:06:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245629#M774663</guid>
      <dc:creator>JackGraus</dc:creator>
      <dc:date>2007-12-31T10:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: read excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245630#M774664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what does i_tab_raw_data imply here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Dec 2007 10:07:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245630#M774664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-31T10:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: read excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245631#M774665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;then it should of type string i suppose&lt;/P&gt;&lt;P&gt;as all the three fields are of variable length&lt;/P&gt;&lt;P&gt;and hence each field should be treated as string itself&lt;/P&gt;&lt;P&gt;how to solve this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Dec 2007 10:10:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245631#M774665</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-31T10:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: read excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245632#M774666</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;That ITAB is used to store Raw data .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just create an internal table of type TRUXS_T_TEXT_DATA&lt;/P&gt;&lt;P&gt;and assigh that table to the parameter  (You need to declare type-pools TRUXS in your program )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Rk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Dec 2007 10:13:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245632#M774666</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-31T10:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: read excel file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245633#M774667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sumesh,&lt;/P&gt;&lt;P&gt;try the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are also a couple of alternatives which use fucntion modules &amp;#145;KCD_EXCEL_OLE_TO_INT_CONVERT&amp;#146;&lt;/P&gt;&lt;P&gt;and &amp;#145;ALSM_EXCEL_TO_INTERNAL_TABLE&amp;#146; but the method below is by far the simplest method to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;..&lt;/P&gt;&lt;P&gt;*: Description :&lt;/P&gt;&lt;P&gt;*: &amp;#151;&amp;#151;&amp;#151;&amp;#150; :&lt;/P&gt;&lt;P&gt;*: This is a simple example program to get data from an excel :&lt;/P&gt;&lt;P&gt;*: file and store it in an internal table. :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: Author : &lt;A href="https://community.sap.com/www.sapdev.co.uk" target="test_blank"&gt;www.sapdev.co.uk&lt;/A&gt;, based on code from Jayanta :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: SAP Version : 4.7 :&lt;/P&gt;&lt;P&gt;*:&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;&amp;#133;:&lt;/P&gt;&lt;P&gt;REPORT zupload_excel_to_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: truxs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_file TYPE rlgrap-filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_datatab,&lt;/P&gt;&lt;P&gt;col1(30) TYPE c,&lt;/P&gt;&lt;P&gt;col2(30) TYPE c,&lt;/P&gt;&lt;P&gt;col3(30) TYPE c,&lt;/P&gt;&lt;P&gt;END OF t_datatab.&lt;/P&gt;&lt;P&gt;DATA: it_datatab type standard table of t_datatab,&lt;/P&gt;&lt;P&gt;wa_datatab type t_datatab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_raw TYPE truxs_t_text_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;At selection screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;#145;F4_FILENAME&amp;#146;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;field_name = &amp;#145;P_FILE&amp;#146;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;file_name = p_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;#145;TEXT_CONVERT_XLS_TO_SAP&amp;#146;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_FIELD_SEPERATOR =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;i_line_header = &amp;#145;X&amp;#146;&lt;/P&gt;&lt;P&gt;i_tab_raw_data = it_raw &amp;#148; WORK TABLE&lt;/P&gt;&lt;P&gt;i_filename = p_file&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;i_tab_converted_data = it_datatab[] &amp;#147;ACTUAL DATA&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;conversion_failed = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&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;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;LOOP AT it_datatab INTO wa_datatab.&lt;/P&gt;&lt;P&gt;WRITE:/ wa_datatab-col1,&lt;/P&gt;&lt;P&gt;wa_datatab-col2,&lt;/P&gt;&lt;P&gt;wa_datatab-col3.&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Shilpi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Dec 2007 10:20:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-excel-file/m-p/3245633#M774667</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-31T10:20:00Z</dc:date>
    </item>
  </channel>
</rss>

