<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5178079#M1198743</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at  internal table where matnr = &amp;lt;fs&amp;gt;-matnr
                                    and werks = &amp;lt;fs&amp;gt;-werks
                                    and  erfme = &amp;lt;fs&amp;gt;-erfme
                                    and lgort SPACE..
v_tabix = sy-tabix.
exit
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Feb 2009 21:07:51 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2009-02-23T21:07:51Z</dc:date>
    <item>
      <title>Read Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5178078#M1198742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;READ TABLE internal table with KEY matnr = &amp;lt;fs&amp;gt;-matnr&lt;/P&gt;&lt;P&gt;                           werks = &amp;lt;fs&amp;gt;-werks&lt;/P&gt;&lt;P&gt;                           erfme = &amp;lt;fs&amp;gt;-erfme&lt;/P&gt;&lt;P&gt;                           lgort &amp;lt;&amp;gt; SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code does not compile because of the lgort negative condition.  Is there aonther wa I can find the index of the internal table meeting all of the conditions above?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 20:50:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5178078#M1198742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T20:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5178079#M1198743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at  internal table where matnr = &amp;lt;fs&amp;gt;-matnr
                                    and werks = &amp;lt;fs&amp;gt;-werks
                                    and  erfme = &amp;lt;fs&amp;gt;-erfme
                                    and lgort SPACE..
v_tabix = sy-tabix.
exit
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 21:07:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5178079#M1198743</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-02-23T21:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5178080#M1198744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should sort the table in matnr, werks, erfme ascending and lgort descending, then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ TABLE internal table with KEY matnr = &amp;lt;fs&amp;gt;-matnr
werks = &amp;lt;fs&amp;gt;-werks
erfme = &amp;lt;fs&amp;gt;-erfme 
binary search.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is a record that has lgort NE SPACE, it will be picked, but if there is only a record with LGORT = SPACE, it will also be picked, so you have to check after the read the value of LGORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am assuming that since you haven't stated otherwise, you are using a standard table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Feb 23, 2009 4:14 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 21:13:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5178080#M1198744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T21:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5178081#M1198745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Gregory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try following &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: indx like sy-tabix.
Loop at it into it where matnr EQ &amp;lt;fs&amp;gt;-matnr and werks EQ &amp;lt;fs&amp;gt;-werks and erfme EQ &amp;lt;fs&amp;gt;-erfme and lgort NE ''.
indx = sy-tabix.
exit.
endloop.
write: indx.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope will Solve out your problem,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Reply if any issue,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 21:14:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5178081#M1198745</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-02-23T21:14:31Z</dc:date>
    </item>
  </channel>
</rss>

