<?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: help needed with read statment in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012705#M410976</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;You need to sort ITAB, please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT ITAB.

LOOP AT ITAB.
  READ TABLE ITAB1 WITH KEY NUM = ITAB-NO BINARY SEARCH.

  IF SY-SUBRC NE 0.
    DELETE ITAB.
  ENDIF.

ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Mar 2007 22:59:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-19T22:59:27Z</dc:date>
    <item>
      <title>help needed with read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012702#M410973</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;LOOP AT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE itab1 WITH KEY num = itab-NO BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&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;EVEN THOUGH THE RECORD EXIST IN ITAB1 FOR ITAB-NO SOMETIMES ITS RETURNING A SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought it is because of binarch search and my data in itab1 is not in a sorted order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does that causes sy-subrc  to be non-zero even though the records exist in internal table itab1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 22:16:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012702#M410973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T22:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: help needed with read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012703#M410974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it does. You must sort when you are reading a table with BINARY SEARCH.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 22:19:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012703#M410974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T22:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: help needed with read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012704#M410975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure that you sort the internal table being read before the LOOP.  Sort it in the order of which you are accessing it.  In this case, sort by NUM.   If you remove the BINARY SEARCH extension, it will work without sorting, but will be a little slower.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 22:22:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012704#M410975</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-03-19T22:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: help needed with read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012705#M410976</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;You need to sort ITAB, please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT ITAB.

LOOP AT ITAB.
  READ TABLE ITAB1 WITH KEY NUM = ITAB-NO BINARY SEARCH.

  IF SY-SUBRC NE 0.
    DELETE ITAB.
  ENDIF.

ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 22:59:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012705#M410976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T22:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: help needed with read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012706#M410977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a small correction to Ferry's response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should be sort itab1 by .NUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie the internal table must be sorted by the key field with which you READ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 23:56:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-needed-with-read-statment/m-p/2012706#M410977</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2007-03-19T23:56:19Z</dc:date>
    </item>
  </channel>
</rss>

