<?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 Syntax for Reading Internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157380#M119283</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 need to read an internaltable itab where column col1 not equal to 'XXX'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my statment will be&lt;/P&gt;&lt;P&gt;read table itab with key col1 ne 'XXXX'.&lt;/P&gt;&lt;P&gt;since this is not working,&lt;/P&gt;&lt;P&gt;how can i write this statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jan 2006 14:07:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-01-20T14:07:12Z</dc:date>
    <item>
      <title>Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157380#M119283</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 need to read an internaltable itab where column col1 not equal to 'XXX'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my statment will be&lt;/P&gt;&lt;P&gt;read table itab with key col1 ne 'XXXX'.&lt;/P&gt;&lt;P&gt;since this is not working,&lt;/P&gt;&lt;P&gt;how can i write this statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 14:07:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157380#M119283</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T14:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157381#M119284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF you are pretty sure that there will be only one record then do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT itab INTO wa WHERE col1 NE 'XXX'&lt;/P&gt;&lt;P&gt;   EXIT.&lt;/P&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 14:10:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157381#M119284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T14:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157382#M119285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Loop At ITAB.&lt;/P&gt;&lt;P&gt;  Use this kind of syntax(logic)&lt;/P&gt;&lt;P&gt;  instead of READ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Bcos&lt;/P&gt;&lt;P&gt;   READ will return only 1 record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : t001 like table of t001 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from t001&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into table t001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t001 where bukrs &amp;lt;&amp;gt; '1000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 14:11:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157382#M119285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T14:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157383#M119286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table will give only one record, so you can use..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at itab where col1 &amp;lt;&amp;gt; vlaue.

"after doing what ever you want..
exit.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 14:15:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157383#M119286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T14:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157384#M119287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All, &lt;/P&gt;&lt;P&gt;In mY program I have 2 internal tables.&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read itab with key col2 = itab1-col2 col1 ne 'XXXX'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 14:18:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157384#M119287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T14:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157385#M119288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Here also u can use second loop (preferable to read)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2 where col2 = itab1-cols and col1 &amp;lt;&amp;gt; 'XXXX'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;endloop.&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;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 14:21:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157385#M119288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T14:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157386#M119289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab1.
loop at itab where  col2 = itab1-col2 
                  and col1 ne 'XXXX'.
"do required stuff..
exit.
endloop.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 14:32:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157386#M119289</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T14:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157387#M119290</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 doen't allow  ne operator.&lt;/P&gt;&lt;P&gt;    try using loop at itab where var &amp;lt;&amp;gt; 'xxx'.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 14:35:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157387#M119290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T14:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157388#M119291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;  Read statement does not take NE.You have to use loop &amp;amp; where condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 14:36:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157388#M119291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T14:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Reading Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157389#M119292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If both internal tables are large, then the nested looping will be slow. This should be faster:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab1.
* Get the first matching record
  READ TABLE itab
    WITH KEY col1 = itab1-col1
    BINARY SEARCH.
  IF itab-col2 &amp;lt;&amp;gt; 'XXXX'.
* Process the record
  ENDIF.
  itab_index = sy-tabix.
  WHILE sy-subrc = 0.
    itab_index = itab_index + 1.
* Get subsequent matching records
    READ TABLE itab INDEX itab_index.
    IF sy-subrc   = 0 AND
       itab-col1 = itab1-col1.
      IF itab-col2 &amp;lt;&amp;gt; 'XXXX'.
* Process the record
      ENDIF.
    ELSE.
* No matching records or end of internal table
      sy-subrc = 99.
    ENDIF.
  ENDWHILE.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If one or both tables are small, then it won't make much difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2006 16:16:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-reading-internal-table/m-p/1157389#M119292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-20T16:16:03Z</dc:date>
    </item>
  </channel>
</rss>

