<?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: Need better solution in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560800#M1431299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keshav is right here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBAK and VBAP have mixed entries, some entries are not present in VBAP which are present in VBAK and vice versa. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ is hence needed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, Thanks to all the solution providers for giving so many alternatives. I have read all of them and will use the suitable one based on my requirement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot to everyone once again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2010 11:47:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-29T11:47:27Z</dc:date>
    <item>
      <title>Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560785#M1431284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Please find the below code segment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT itab_vbap INTO wa_vbap.
READ TABLE itab_vbak INTO wa_vbak
         WITH KEY vbeln = wa_vbap-vbeln BINARY SEARCH.
IF wa_vbap-zshipdate NOT IN s_fsd.
          DELETE itab_vbap WHERE vbeln = wa_vbak-vbeln.
        ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code segment is working fine, but I need a better solution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reason: I feel the DELETE statement which is deleting entries from the ITAB vbap is inside the LOOP of vbap and thus this might result in some inconsistency. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The READ statement is written because to make sure those entries are deleted which are present in VBAK and VBAP and satisfies the given condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please provide an alternative and better solution to this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 09:24:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560785#M1431284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T09:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560786#M1431285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;First of all where in delete is not good for peformance reasons. And use continue after delete so loop will continue with next pass. Check below code it should be ok. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: lv_tabix type sy-tabix. 
LOOP AT itab_vbap INTO wa_vbap.
 lv_tabix = sy-tabix.
READ TABLE itab_vbak INTO wa_vbak
         WITH KEY vbeln = wa_vbap-vbeln BINARY SEARCH.
IF wa_vbap-zshipdate NOT IN s_fsd.
          DELETE itab_vbap index lv_tabix. 
          continue.
        ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gungor Ozcelebi on Jan 29, 2010 10:31 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 09:31:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560786#M1431285</guid>
      <dc:creator>former_member194416</dc:creator>
      <dc:date>2010-01-29T09:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560787#M1431286</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;PRE&gt;&lt;CODE&gt;LOOP AT itab_vbap INTO wa_vbap.

READ TABLE itab_vbak INTO wa_vbak
         WITH KEY vbeln = wa_vbap-vbeln BINARY SEARCH.

if sy-subrc = 0.

IF wa_vbap-zshipdate NOT IN s_fsd.
          DELETE itab_vbap WHERE vbeln = wa_vbak-vbeln.
        ENDIF.
endif.

clear : wa_vbap,wa_vbak .

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 09:31:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560787#M1431286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T09:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560788#M1431287</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;Declare the tmp date and delete it from the original internal table.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT itab_vbap_tmp INTO wa_vbap_tmp.&lt;/P&gt;&lt;P&gt;IF wa_vbap_tmp-zshipdate NOT IN s_fsd.&lt;/P&gt;&lt;P&gt;          DELETE itab_vbap WHERE vbeln = wa_vbap_tmp-vbeln.&lt;/P&gt;&lt;P&gt;        ENDIF.&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;Bharani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 09:42:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560788#M1431287</guid>
      <dc:creator>BH2408</dc:creator>
      <dc:date>2010-01-29T09:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560789#M1431288</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;delete statement inside a loop should not lead to any inconsistency. You are not testing a sy-subrc after READ statement in you code. Is it necessary to have this statement there in such case? You can probably do it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT itab_vbap INTO wa_vbap WHERE zshipdate NOT IN s_fsd.
 DELETE itab_vbap WHERE vbeln EQ wa_vbap-vbeln.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example is deleting all positions for VBELN if at least one of them have zshipdate NOT IN s_fsd as in your code. If You want to delete only positions with zshipdate NOT IN s_fsd, You can do it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DELETE itab_vbap WHERE  zshipdate NOT IN s_fsd.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 09:51:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560789#M1431288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T09:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560790#M1431289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi instead of deleting move the required entries into another itab.&lt;/P&gt;&lt;P&gt;Atleast we can git rid rebuilding the itab index during delete.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 09:57:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560790#M1431289</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-29T09:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560791#M1431290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keshav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you have learnt this technique from SDN &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 10:00:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560791#M1431290</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-01-29T10:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560792#M1431291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can loop at a copy of itab_vbap and delete from the original table itab_vbap. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: itab_vbap_cp LIKE itab_vbap.
itab_vbap_cp = itab_vbap.

LOOP AT itab_vbap_cp INTO wa_vbap.
READ TABLE itab_vbak INTO wa_vbak
         WITH KEY vbeln = wa_vbap-vbeln BINARY SEARCH.
  IF wa_vbap-zshipdate NOT IN s_fsd.
    DELETE itab_vbap WHERE vbeln = wa_vbak-vbeln.
  ENDIF.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can collect the entiries to be deleted in the loop, and delete them after the loop is finished.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: itab_vbap_todel LIKE itab_vbap.

LOOP AT itab_vbap INTO wa_vbap.
READ TABLE itab_vbak INTO wa_vbak
         WITH KEY vbeln = wa_vbap-vbeln BINARY SEARCH.
  IF wa_vbap-zshipdate NOT IN s_fsd.
    APPEND wa_vbap TO itab_vbap_todel.
  ENDIF.
ENDLOOP.

LOOP AT itab_vbap_todel INTO wa_vbap.
  DELETE itab_vbap WHERE vbeln = wa_vbap-vbeln.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Hubert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 10:05:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560792#M1431291</guid>
      <dc:creator>hubert_heitzer</dc:creator>
      <dc:date>2010-01-29T10:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560793#M1431292</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;Suhas ... Its From Tips and tricks of henin frank &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@chandan sinha - The read statemnt is hanging independently without a subrc check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 10:05:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560793#M1431292</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-29T10:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560794#M1431293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey buddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you asked a similar question y'day. Is the tips &amp;amp; tricks available on SDN ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 10:11:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560794#M1431293</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-01-29T10:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560795#M1431294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandan Sinha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After ovserving your code i suggest below way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please replace your code with below single statement... it will do the deletion task..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only Single statement is enough for it..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DELETE itab_vbap WHERE zshipdate NOT IN s_fsd.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No need to use LOOP and rebuilding indexes and all..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope it will solve your problem..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;ilesh 24x7&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ilesh Nandaniya&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 10:13:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560795#M1431294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T10:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560796#M1431295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was a different one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That code was not mine &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;link:[http://www.henrikfrank.dk/abaptips/]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its explained somewhere in the link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 10:30:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560796#M1431295</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-29T10:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560797#M1431296</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 think he didnt use the read statement unnecessarily.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What if the records should be deleted only if the sy-subrc is true after read statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 10:32:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560797#M1431296</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-29T10:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560798#M1431297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keshav T,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the Suggession/Correction..  You may be true also.. Now Only &lt;STRONG&gt;Chandan&lt;/STRONG&gt; can say what exaclty he needs.. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But As I think He used READ statement unnecessorily as per the code snippet he has given... &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yes about READ Statement Condition.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;He is checking existenance of VBELN in VBAK... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple Process .. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If item table (VBAP) has sale order then... it must be present in Header Table (VBAK).. So there is no need to check it...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Correct me If I am wrong..&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But At last.. I would say it all depends on what is his final requirement.. and How he is filling Internal tables IT_VBAK and IT_VBAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;ilesh 24x7&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ilesh Nandaniya&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 10:43:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560798#M1431297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T10:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560799#M1431298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah its correct,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But chances are there that the table itab_vbak might have been populated based on some conditions..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If its just populated without any filtering then what you say is correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 11:07:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560799#M1431298</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-29T11:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560800#M1431299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keshav is right here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBAK and VBAP have mixed entries, some entries are not present in VBAP which are present in VBAK and vice versa. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ is hence needed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, Thanks to all the solution providers for giving so many alternatives. I have read all of them and will use the suitable one based on my requirement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot to everyone once again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 11:47:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560800#M1431299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T11:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560801#M1431300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;STOP!.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's obvious that both internal tables were sourced from SAP transparent tables at some point, so why on earth are you looping through and performing this riduculous process?. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, you should have performed one SQL extract and put the same logic into the WHERE clause. Let the database do the work, that's what it's built for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ....&lt;/P&gt;&lt;P&gt;    INTO itab_vbap&lt;/P&gt;&lt;P&gt;    FROM vbap as a&lt;/P&gt;&lt;P&gt;   INNER JOIN vbak as b ON a&lt;SUB&gt;vbeln EQ b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;                                      AND ....&lt;/P&gt;&lt;P&gt;   WHERE zshiodate IN s_fsd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, if you have to ignore this advice and continue with this LOOP then at least limit what's return by the LOOP and READ statement, using TRANSPORTING NO FIELDS, or transporting just the fields required. You don't need to use all fields, if you just intend to delete the record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;(With help from Dr Sidewalk.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jason Stratham on Jan 29, 2010 1:43 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 12:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560801#M1431300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T12:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need better solution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560802#M1431301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 13:25:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-better-solution/m-p/6560802#M1431301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T13:25:14Z</dc:date>
    </item>
  </channel>
</rss>

