<?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 statement keeps failing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018686#M1806268</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can't make much of the screen shot, but you're using BINARY SEARCH. Is the table sorted based on the fields you're searching for?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jan 2014 22:22:43 GMT</pubDate>
    <dc:creator>former_member192854</dc:creator>
    <dc:date>2014-01-16T22:22:43Z</dc:date>
    <item>
      <title>READ TABLE statement keeps failing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018685#M1806267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a tough time to do a simple READ TABLE statement on two tables. My two tables are (&amp;nbsp; pi_git_zrerate_dtl ) and ( lt_zrerate_output_vf ) and both have same data and fields as well which I want to compare but when READ TABLE statement always fails when in pi_git_zrerate_dtl table VBELN is same on multiple rows. I even try to pass other fields (KDMAT and POSNR) which are not same and should make a unique records but still READ fails (as shown in below screen shots).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/364870" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.sap.com/" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/364938" /&gt;&lt;/P&gt;&lt;P&gt;Can anybody see what mistake I'm making in the above code and please tell me how to rectify it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 22:14:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018685#M1806267</guid>
      <dc:creator>former_member295881</dc:creator>
      <dc:date>2014-01-16T22:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE statement keeps failing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018686#M1806268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can't make much of the screen shot, but you're using BINARY SEARCH. Is the table sorted based on the fields you're searching for?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 22:22:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018686#M1806268</guid>
      <dc:creator>former_member192854</dc:creator>
      <dc:date>2014-01-16T22:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE statement keeps failing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018687#M1806269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;I can see you are using the addtion "BINARY SEARCH" in your read statement.&amp;nbsp; To use this however you need to ensure that you apply a sort on your table based on the key fields you are searching.&amp;nbsp; I can't see if you are doing this from your screenshot, but it looks like a good place to start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can quickly test if this is the cause by removing this addition from your read statement and retesting.&amp;nbsp; If it works, then you should add the statement back in and perform the sort on the table before reading from it.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a side point you should also consider:&lt;/P&gt;&lt;P&gt;- tables of type sorted (performance gains on read and "BINARY SEARCH"is implied, cost increase on insert statements)&lt;/P&gt;&lt;P&gt;- if the table is usually small, have you considered removing the binary search and not sorting it (quick for small tables, cost of read is that the whole table is read to find the record)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the most likely production scenario is for you requirement is what you should aim to code for to get the best performance gains.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Katan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 22:29:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018687#M1806269</guid>
      <dc:creator>Katan</dc:creator>
      <dc:date>2014-01-16T22:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE statement keeps failing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018688#M1806270</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;Remove binary search from the statement and then try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check whether the length of the equating fields for target(LWA) and source(GWA) is same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;confirm that there is no space in the end of GWA,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try using conversion exits for the source variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Akshay Ruia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 05:11:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018688#M1806270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-01-17T05:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE statement keeps failing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018689#M1806271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;whenever you use BINARY SEARCH, make sure that your table is SORTED.&lt;/P&gt;&lt;P&gt;So please do it accordingly, first sort your internal table based on your main &lt;/P&gt;&lt;P&gt;field (say ebeln)&amp;nbsp; and then use binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will makes your output as you wants. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 05:26:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018689#M1806271</guid>
      <dc:creator>former_member187748</dc:creator>
      <dc:date>2014-01-17T05:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE statement keeps failing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018690#M1806272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First sort your internal table on vbeln_or kdmat vgpos. Then use binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 06:33:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018690#M1806272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-01-17T06:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE statement keeps failing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018691#M1806273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sander,&lt;/P&gt;&lt;P&gt;Just to let you know.&amp;nbsp; I had no intention of copying what you wrote.&amp;nbsp; When I initially hit reply, there were no responses and only after I submit my response did I see you had also replied with the same approach.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Katan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 06:56:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018691#M1806273</guid>
      <dc:creator>Katan</dc:creator>
      <dc:date>2014-01-17T06:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE statement keeps failing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018692#M1806274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Katan,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;no worries, I already had the feeling you didn't do it on purpose.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 07:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement-keeps-failing/m-p/10018692#M1806274</guid>
      <dc:creator>former_member192854</dc:creator>
      <dc:date>2014-01-17T07:46:25Z</dc:date>
    </item>
  </channel>
</rss>

