<?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 Table itab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143420#M451827</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read table ITABB with key K1 = V1...means the table itab will be read for the key k1 whose value would be V1&amp;lt;b&amp;gt; Linearly&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By adding Binary search we try to improve the performance of the read stament by reducing the number of comparisions...mind u the table should be sorted first..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table returns sy-subrc if failed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table stmt exits any search after it has found atleast one record inthe concerened table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2007 11:46:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-18T11:46:04Z</dc:date>
    <item>
      <title>Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143414#M451821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Freinds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one explain me ? what is the above statement means, and can u give me sample program. points for sure...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Read table itab with key k1 = v1....kn = vn[Binary Search]&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and reagrds&lt;/P&gt;&lt;P&gt;Vijaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:42:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143414#M451821</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143415#M451822</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 reads the internal table with the key you specify. It uses binary serach for searching the record.see that you sort the internal table before using binary search for effective output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Navneeth.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:43:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143415#M451822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143416#M451823</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;Reading a  value in the internal table with the condition mentioned in the with key.&lt;/P&gt;&lt;P&gt;And if u use Binary search, then the table should be sorted compulsory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Krishna K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:44:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143416#M451823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143417#M451824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;here k1... kn denotes the field of the internal table and v1...vn denotes the value it is compared with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Navneeth.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:45:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143417#M451824</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143418#M451825</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 is to read the data from the internal table with the keys specified.&lt;/P&gt;&lt;P&gt;The BINARY SEARCH addition means that you can access a record in a table by its key as quickly as you would be able to in a sorted table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;REPORT demo_int_tables_read_index_bin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF line,&lt;/P&gt;&lt;P&gt;        col1 TYPE i,&lt;/P&gt;&lt;P&gt;        col2 TYPE i,&lt;/P&gt;&lt;P&gt;      END OF line.&lt;/P&gt;&lt;P&gt;DATA itab LIKE STANDARD TABLE OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 4 TIMES.&lt;/P&gt;&lt;P&gt;  line-col1 = sy-index.&lt;/P&gt;&lt;P&gt;  line-col2 = sy-index ** 2.&lt;/P&gt;&lt;P&gt;  APPEND line TO itab.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;SORT itab BY col2.&lt;/P&gt;&lt;P&gt;READ TABLE itab WITH KEY col2 = 16 INTO line BINARY SEARCH.&lt;/P&gt;&lt;P&gt;WRITE: 'SY-SUBRC =', sy-subrc.&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;madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:45:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143418#M451825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143419#M451826</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 is to read a record from an internal table based on certain key fields e.g. k1, k2 etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table itab with key matnr = '43243223'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using Binary search, then u need to sort the internal table by that field mentioned in the key fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;SORT ITAB by MATNR.&lt;/P&gt;&lt;P&gt;Read table itab with key matnr = '43243223'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:45:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143419#M451826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143420#M451827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read table ITABB with key K1 = V1...means the table itab will be read for the key k1 whose value would be V1&amp;lt;b&amp;gt; Linearly&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By adding Binary search we try to improve the performance of the read stament by reducing the number of comparisions...mind u the table should be sorted first..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table returns sy-subrc if failed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table stmt exits any search after it has found atleast one record inthe concerened table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:46:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143420#M451827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143421#M451828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any sample program ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:46:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143421#M451828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143422#M451829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here an internal table itab has multiple records.&lt;/P&gt;&lt;P&gt;Each Record is uniquey identified by the combination of key fields k1 through kn.&lt;/P&gt;&lt;P&gt;This statement would retrun you the record that matches to the values that are specified in v1 through vn.&lt;/P&gt;&lt;P&gt;The binary search will speed up the search process.&lt;/P&gt;&lt;P&gt;example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 10 times.&lt;/P&gt;&lt;P&gt;itab-number = sy-index.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by number.&lt;/P&gt;&lt;P&gt;read table itab with key number = 5 binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;write:/ itab-number. "Outputs 5&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:46:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143422#M451829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143423#M451830</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;I must add, that it reads only one record from the internal table (the one that fulfills the conditions you declared after KEY).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:46:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143423#M451830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143424#M451831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Reads the internal Table with key fields&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Move the data to Final Output Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at i_bsis.&lt;/P&gt;&lt;P&gt;    i_final-belnr = i_bsis-belnr.     " FI Document&lt;/P&gt;&lt;P&gt;    i_final-monat = i_bsis-monat.     " Period&lt;/P&gt;&lt;P&gt;    i_final-budat = i_bsis-budat.     " Rec. Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Transaction Currency from BKPF Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    read table i_bkpf with key bukrs = i_bsis-bukrs&lt;/P&gt;&lt;P&gt;                               belnr = i_bsis-belnr&lt;/P&gt;&lt;P&gt;                               gjahr = i_bsis-gjahr&lt;/P&gt;&lt;P&gt;                               binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      i_final-waers = i_bkpf-waers.     " Tran.Currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Movement Type for all Material Related&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Documents from MSEG Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      if i_bkpf-awtyp = c_mkpf.&lt;/P&gt;&lt;P&gt;        read table i_mseg with key mblnr = i_bkpf-awkey(10)&lt;/P&gt;&lt;P&gt;                                   mjahr = i_bkpf-awkey+10(4).&lt;/P&gt;&lt;P&gt;        if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          i_final-bwart = i_mseg-bwart.     " Movement Type&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read Vendor, Plant, PO Document, Local And Trans.Amounts&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;from BSEG Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    read table i_bseg with key bukrs = i_bsis-bukrs&lt;/P&gt;&lt;P&gt;                               belnr = i_bsis-belnr&lt;/P&gt;&lt;P&gt;                               gjahr = i_bsis-gjahr&lt;/P&gt;&lt;P&gt;                               buzei = i_bsis-buzei&lt;/P&gt;&lt;P&gt;                               binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      i_final-lifnr = i_bseg-lifnr.     " Vendor&lt;/P&gt;&lt;P&gt;      i_final-werks = i_bseg-werks.     " Plant&lt;/P&gt;&lt;P&gt;      i_final-ebeln = i_bseg-ebeln.     " PO&lt;/P&gt;&lt;P&gt;      i_final-dmbtr = i_bseg-dmbtr.     " Local Amount&lt;/P&gt;&lt;P&gt;      i_final-wrbtr = i_bseg-wrbtr.     " Tran.Amount&lt;/P&gt;&lt;P&gt;      i_final-menge = i_bseg-menge.     " Quantity&lt;/P&gt;&lt;P&gt;      i_final-meins = i_bseg-meins.     " UOM&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;For Credit Indicator(SHKZG = H) amounts should be (-)ve&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      if i_bseg-shkzg = c_h.&lt;/P&gt;&lt;P&gt;        i_final-dmbtr = i_final-dmbtr * -1.&lt;/P&gt;&lt;P&gt;        i_final-wrbtr = i_final-wrbtr * -1.&lt;/P&gt;&lt;P&gt;        i_final-menge = i_final-menge * -1.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Material and its Description from EKPO Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      read table i_ekpo with key ebeln = i_bseg-ebeln&lt;/P&gt;&lt;P&gt;                                 ebelp = i_bseg-ebelp&lt;/P&gt;&lt;P&gt;                                 matnr = i_bseg-matnr&lt;/P&gt;&lt;P&gt;                                 binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        i_final-matnr = i_ekpo-matnr.     " Material Number&lt;/P&gt;&lt;P&gt;        i_final-txz01 = i_ekpo-txz01.     " Material Text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate the Material Status depending on the Input Checkbox&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;On Selection Screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if not i_ekpo-matnr is initial.&lt;/P&gt;&lt;P&gt;          i_final-status = c_x.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the PO related Cost Element and Cost Centers&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;from EKKN Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      read table i_ekkn with key ebeln = i_bseg-ebeln&lt;/P&gt;&lt;P&gt;                                 ebelp = i_bseg-ebelp&lt;/P&gt;&lt;P&gt;                                 binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        i_final-kostl = i_ekkn-kostl.     " Cost Center&lt;/P&gt;&lt;P&gt;        i_final-sakto = i_ekkn-sakto.     " Cost Element&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Valuation Class from MBEW Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      read table i_mbew with key matnr = i_bseg-matnr&lt;/P&gt;&lt;P&gt;                                 werks = i_bseg-werks&lt;/P&gt;&lt;P&gt;                                 binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        i_final-bklas = i_mbew-bklas.     " Val Class&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Vendor Name from LFA1 Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      read table i_lfa1 with key lifnr = i_bseg-lifnr&lt;/P&gt;&lt;P&gt;                                 binary search.&lt;/P&gt;&lt;P&gt;      if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        i_final-name1 = i_lfa1-name1.     " Vendor Name&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    append i_final.&lt;/P&gt;&lt;P&gt;    clear i_final.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  sort i_final by lifnr werks monat matnr.&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:46:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143424#M451831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143425#M451832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table helps you to get a particular record in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF line,&lt;/P&gt;&lt;P&gt;        col1 TYPE i,&lt;/P&gt;&lt;P&gt;        col2 TYPE i,&lt;/P&gt;&lt;P&gt;      END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab LIKE HASHED TABLE OF line WITH UNIQUE KEY col1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 4 TIMES.&lt;/P&gt;&lt;P&gt;  line-col1 = sy-index.&lt;/P&gt;&lt;P&gt;  line-col2 = sy-index ** 2.&lt;/P&gt;&lt;P&gt;  INSERT line INTO TABLE itab.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;line-col1 = 2.&lt;/P&gt;&lt;P&gt;line-col2 = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE itab FROM line INTO line COMPARING col2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'SY-SUBRC =', sy-subrc.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;WRITE: / line-col1, line-col2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Rama.Pammi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:49:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143425#M451832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143426#M451833</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;&lt;/P&gt;&lt;P&gt;Read table itab with key k1 = v1....kn = vn[Binary Search]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;table itab &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c1   c2    c3   c4&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------" /&gt;&lt;P&gt;w1  w2   w3   w4&lt;/P&gt;&lt;P&gt;v1   v2    v3    v4&lt;/P&gt;&lt;P&gt;u1  u2   u3    u4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by c1 c2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;read itab into wa with key c1 = 'v1' c2 = 'v2'  binary search.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;gives you the perfect output .. wa = v1  v2  v3  v4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;read itab into wa with key c1 = 'v1' c2 = 'w2'  binary search.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No result found..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above statement READs the table ITAB with key you specify and the serach is binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorting the table is mandatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;nazeer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:49:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143426#M451833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143427#M451834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijaya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a READ statement which will get an entry from the internal table for the values specified for the keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have more than one entry with the specified values for the keys, it will only fetch the first successful entry from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The addition BINARY SEARCH makes you faster to search on a particular field with the value. Prior to using BINARY SEARCH on a field, it should be SORTed on that field on the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_int_tables_read_index_bin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF line,&lt;/P&gt;&lt;P&gt;        col1 TYPE i,&lt;/P&gt;&lt;P&gt;        col2 TYPE i,&lt;/P&gt;&lt;P&gt;      END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab LIKE STANDARD TABLE OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 4 TIMES.&lt;/P&gt;&lt;P&gt;  line-col1 = sy-index.&lt;/P&gt;&lt;P&gt;  line-col2 = sy-index ** 2.&lt;/P&gt;&lt;P&gt;  APPEND line TO itab.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT itab BY col2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE itab WITH KEY col2 = 16 INTO line BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'SY-SUBRC =', sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:50:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143427#M451834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143428#M451835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Read table is used to read table contents........&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF line,&lt;/P&gt;&lt;P&gt;        col1 TYPE i,&lt;/P&gt;&lt;P&gt;        col2 TYPE i,&lt;/P&gt;&lt;P&gt;      END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab LIKE STANDARD TABLE OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 4 TIMES.&lt;/P&gt;&lt;P&gt;  line-col1 = sy-index.&lt;/P&gt;&lt;P&gt;  line-col2 = sy-index ** 2.&lt;/P&gt;&lt;P&gt;  APPEND line TO itab.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT itab BY col2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE itab WITH KEY col2 = 16 INTO line BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'SY-SUBRC =', sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;      Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:55:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143428#M451835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143429#M451836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pls dont copy and paste from help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:58:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143429#M451836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T11:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143430#M451837</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;With addition to my above post chk out the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab like vbak occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;  into table itab&lt;/P&gt;&lt;P&gt;  from vbak&lt;/P&gt;&lt;P&gt;    up to 100 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by vbeln.&lt;/P&gt;&lt;P&gt;read table itab with key vbeln = '0000004969' binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;  write:/ itab-vbeln.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it clears your concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Navneeth.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 12:05:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-itab/m-p/2143430#M451837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T12:05:36Z</dc:date>
    </item>
  </channel>
</rss>

