<?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 Delete records without loop comparing two internal table... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927082#M689608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written two select statement shown below. In it_vbap the whole data is comming apart from  auart = 'ZBEO' or auart = 'ZBOR' or auart = 'ZOLD' or auart = 'ZOEO' .  In it_vbak it is comming O.K.  I want to delete records apart from ZBEO,ZBOR,ZOLD, &amp;amp; ZBEO comparing from it_vbap without loop comparing it_vbap and it_vbak. How to write ? Pl. help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT * FROM vbap client specified&lt;/P&gt;&lt;P&gt;             INTO CORRESPONDING FIELDS OF TABLE it_vbap&lt;/P&gt;&lt;P&gt;             WHERE mandt = sy-mandt and&lt;/P&gt;&lt;P&gt;                   erdat IN dt1    AND&lt;/P&gt;&lt;P&gt;                   matnr IN matnr1 AND&lt;/P&gt;&lt;P&gt;                   gsber = 'HIP'   AND&lt;/P&gt;&lt;P&gt;                   vstel = 'BSP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT * FROM vbak INTO CORRESPONDING FIELDS OF TABLE it_vbak&lt;/P&gt;&lt;P&gt;             FOR ALL ENTRIES IN it_vbap WHERE vbeln = it_vbap-vbeln&lt;/P&gt;&lt;P&gt;                  and ( auart = 'ZBEO' or auart = 'ZBOR'&lt;/P&gt;&lt;P&gt;                     or auart = 'ZOLD' or auart = 'ZOEO' ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yusuf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Oct 2007 08:28:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-20T08:28:22Z</dc:date>
    <item>
      <title>Delete records without loop comparing two internal table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927082#M689608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written two select statement shown below. In it_vbap the whole data is comming apart from  auart = 'ZBEO' or auart = 'ZBOR' or auart = 'ZOLD' or auart = 'ZOEO' .  In it_vbak it is comming O.K.  I want to delete records apart from ZBEO,ZBOR,ZOLD, &amp;amp; ZBEO comparing from it_vbap without loop comparing it_vbap and it_vbak. How to write ? Pl. help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT * FROM vbap client specified&lt;/P&gt;&lt;P&gt;             INTO CORRESPONDING FIELDS OF TABLE it_vbap&lt;/P&gt;&lt;P&gt;             WHERE mandt = sy-mandt and&lt;/P&gt;&lt;P&gt;                   erdat IN dt1    AND&lt;/P&gt;&lt;P&gt;                   matnr IN matnr1 AND&lt;/P&gt;&lt;P&gt;                   gsber = 'HIP'   AND&lt;/P&gt;&lt;P&gt;                   vstel = 'BSP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT * FROM vbak INTO CORRESPONDING FIELDS OF TABLE it_vbak&lt;/P&gt;&lt;P&gt;             FOR ALL ENTRIES IN it_vbap WHERE vbeln = it_vbap-vbeln&lt;/P&gt;&lt;P&gt;                  and ( auart = 'ZBEO' or auart = 'ZBOR'&lt;/P&gt;&lt;P&gt;                     or auart = 'ZOLD' or auart = 'ZOEO' ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yusuf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2007 08:28:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927082#M689608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-20T08:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Delete records without loop comparing two internal table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927083#M689609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of writing different queries on VBAP and VBAK .. you can use JOIN On the two tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other Option is loop at the interal table VBAK and prepare a range ra_vbeln for the Document Number (VBELN). Then you can use the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete it_vbap where vbeln in ra_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2007 09:00:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927083#M689609</guid>
      <dc:creator>former_member195698</dc:creator>
      <dc:date>2007-10-20T09:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Delete records without loop comparing two internal table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927084#M689610</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 it_vabk where auart NE 'ZBEO' or auart NE  'ZBOR' or auart  NE  'ZOLD' or auart NE 'ZOEO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete it_vabk where auart NE 'ZBEO' or auart NE  'ZBOR' or auart  NE  'ZOLD' or auart NE 'ZOEO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or best one is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM vbap client specified&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE it_vbap&lt;/P&gt;&lt;P&gt;WHERE mandt = sy-mandt and&lt;/P&gt;&lt;P&gt;erdat IN dt1 AND&lt;/P&gt;&lt;P&gt;matnr IN matnr1 AND&lt;/P&gt;&lt;P&gt;gsber = 'HIP' AND&lt;/P&gt;&lt;P&gt;vstel = 'BSP' and &lt;/P&gt;&lt;P&gt;AUART =  'ZBEO' and  auart =  'ZBOR' and auart  =  'ZOLD' and  auart = 'ZOEO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay Mekala.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Oct 2007 05:39:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927084#M689610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-21T05:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Delete records without loop comparing two internal table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927085#M689611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vijay,&lt;/P&gt;&lt;P&gt;The document type is not present in VBAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Oct 2007 08:51:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927085#M689611</guid>
      <dc:creator>former_member195698</dc:creator>
      <dc:date>2007-10-21T08:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Delete records without loop comparing two internal table...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927086#M689612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Delete it_vabk where auart NE 'ZBEO' or auart NE&lt;/P&gt;&lt;P&gt;&amp;gt;  'ZBOR' or auart  NE  'ZOLD' or auart NE 'ZOEO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a small annotation. This code would result in deleting the compete table. If you want to delete all entries with keys other than the 4 stated you have to use AND insteat of OR. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOT ( a OR b OR c OR d) is becomming NOT a AND NOT b AND NOT c AND NOT d when elimination the ( ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Oct 2007 16:40:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-without-loop-comparing-two-internal-table/m-p/2927086#M689612</guid>
      <dc:creator>romanweise</dc:creator>
      <dc:date>2007-10-21T16:40:49Z</dc:date>
    </item>
  </channel>
</rss>

