<?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: deleting inside a loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302293#M1222833</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;So basically you can have the following example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;VBELV        POSNV    VBELN        POSNN    VBTYP_N BWART

1300000202   000000   10000384     000001   8
1300000202   000010   20070329     100905   Q
1300000202   000010   4900001632   000001   R       641
1300000202   000010   5000000730   000001   i       101&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what you require is for any doc, if it has one entry with bwart 101 (GR), it should not be displayed. Right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If yes, please do as follows (keep your select without the BWART = 101 restriction):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select VBELV bwart matnr from vbfa&lt;/P&gt;&lt;P&gt;into corresponding fields of table it_vbfa&lt;/P&gt;&lt;P&gt;for all entries in it_lips&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;vbelV = it_lips-vbeln and&lt;/P&gt;&lt;P&gt;matnr = it_lips-matnr."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt; loop at it_vbfa into wa_vbfa.&lt;/P&gt;&lt;P&gt;if wa_vbfa-bwart = '101'.&lt;/P&gt;&lt;P&gt;  r_excl_vbelv-sign = 'I'.&lt;/P&gt;&lt;P&gt;  r_excl_vbelv-option = 'EQ'.&lt;/P&gt;&lt;P&gt;  r_excl_vbelv-low = wa_vbfa-vbelv.&lt;/P&gt;&lt;P&gt;  append r_excl_vbelv.&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;if r_excl_vbelv[] is not intial.&lt;/P&gt;&lt;P&gt; delete it_vbfa where vbelv in r_excl_vbelv.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Dev Parbutteea on Mar 18, 2009 7:17 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Mar 2009 06:17:12 GMT</pubDate>
    <dc:creator>dev_parbutteea</dc:creator>
    <dc:date>2009-03-18T06:17:12Z</dc:date>
    <item>
      <title>deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302283#M1222823</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;part of my code below......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;problem is ....i have used a select stmt from table vbfa where it has a &lt;/P&gt;&lt;P&gt;field called vbelv , it may have any number of documents in it , whenever there&lt;/P&gt;&lt;P&gt;is a movement type  '101', that document should not be displayed in my final alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i restrict in my select using where condition as NE 101, other movement type  are &lt;/P&gt;&lt;P&gt;coming in the output which is NE to 101, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;my criteria is not that, it that document has no 101 in the movemt (BWART) field&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;those document should be displayed else it should not....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i thought of specifying that condition in loop where bwart = 101 &lt;/P&gt;&lt;P&gt;and thought of deleting inside....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i dont know how to code this ....can you pls help me to solve this issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx in advance &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;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;P&gt;SELECTING RECEIVER PLANT AND SLOC.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;    select vbeln pstyv matnr lfimg arktx erdat werks lgort vgbel &lt;STRONG&gt;bwart&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;           from lips into corresponding fields of table it_lips&lt;/P&gt;&lt;P&gt;           for all entries in it_ekko&lt;/P&gt;&lt;P&gt;           where vgbel =  it_ekko-ebeln and&lt;/P&gt;&lt;P&gt;                 werks =  it_ekko-reswk and&lt;/P&gt;&lt;P&gt;                 aedat = it_ekko-bedat and&lt;/P&gt;&lt;P&gt;                 lgort in so_sen and&lt;/P&gt;&lt;P&gt;                 matnr in so_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****added for mvmt type NE 101&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;select VBELV  bwart matnr from vbfa&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;into  corresponding fields of table it_vbfa&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                &lt;STRONG&gt;for all entries in it_lips&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                &lt;STRONG&gt;where&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                      &lt;STRONG&gt;vbelV = it_lips-vbeln and&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                      &lt;STRONG&gt;matnr = it_lips-matnr&lt;/STRONG&gt;." and&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                     bwart &amp;lt;&amp;gt; '101' and bwart &amp;lt;&amp;gt; ' '. .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop at it_lips into wa_lips .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    read table it_ekpo into wa_ekpo with key ebeln = wa_lips-vgbel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;      wa_final-aedat   = wa_ekpo-aedat.&lt;/P&gt;&lt;P&gt;      wa_final-ebeln   = wa_lips-vgbel.&lt;/P&gt;&lt;P&gt;      wa_final-senp    = wa_lips-werks.&lt;/P&gt;&lt;P&gt;      wa_final-sen     = wa_lips-lgort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:35:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302283#M1222823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T05:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302284#M1222824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;If you want to fetch only those documents where movemt (BWART) field = 101, why you need NE 101.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;select vbeln pstyv matnr lfimg arktx erdat werks lgort vgbel bwart&lt;/P&gt;&lt;P&gt;from lips into corresponding fields of table it_lips&lt;/P&gt;&lt;P&gt;for all entries in it_ekko&lt;/P&gt;&lt;P&gt;where vgbel = it_ekko-ebeln and&lt;/P&gt;&lt;P&gt;werks = it_ekko-reswk and&lt;/P&gt;&lt;P&gt;aedat = it_ekko-bedat and&lt;/P&gt;&lt;P&gt;lgort in so_sen and&lt;/P&gt;&lt;P&gt;matnr in so_matnr&lt;/P&gt;&lt;P&gt;and bwart = 101.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302284#M1222824</guid>
      <dc:creator>Sandeep_Panghal</dc:creator>
      <dc:date>2009-03-18T05:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302285#M1222825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If bwart NE  '101'.&lt;/P&gt;&lt;P&gt; you can write ur select statement here..----&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;&amp;gt; In this way you can fetch only the required records.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;In this way u can avoid..&lt;/P&gt;&lt;P&gt;Hope this is what you are looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:40:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302285#M1222825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T05:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302286#M1222826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanx for your reply....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but my requirement is that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when it sees 101 in that document it should not be displayed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you said if i give = 101 ,,,,it willl fetch that document ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i give NE 101 , it will fetch the same  document where the mvmt type will be 334 667 etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;wat i need is ,,,,there may be 3 to 4  same document no with different mvmt type , if that doucment has 101 , i dont want it to be displayed&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:48:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302286#M1222826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T05:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302287#M1222827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbelv bwart matnr &lt;/P&gt;&lt;P&gt;  from vbfa&lt;/P&gt;&lt;P&gt;   into corresponding fields of table it_vbfa&lt;/P&gt;&lt;P&gt;     for all entries in it_lips&lt;/P&gt;&lt;P&gt;where vbelv eq it_lips-vbeln &lt;/P&gt;&lt;P&gt;   and matnr eq it_lips-matnr&lt;/P&gt;&lt;P&gt;   and bwart eq '101' .&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;Joan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:50:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302287#M1222827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T05:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302288#M1222828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmmm....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then first select all documents.&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;if  bwart = 101.&lt;/P&gt;&lt;P&gt;delete table itab from wa.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;continue.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:51:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302288#M1222828</guid>
      <dc:creator>Sandeep_Panghal</dc:creator>
      <dc:date>2009-03-18T05:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302289#M1222829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;    In final internal table after appending from workarea, delete final internaltable where bwart eq 101.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;vino.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:54:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302289#M1222829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T05:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302290#M1222830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select VBELV bwart matnr from vbfa&lt;/P&gt;&lt;P&gt;into corresponding fields of table it_vbfa&lt;/P&gt;&lt;P&gt;for all entries in it_lips&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;vbelV = it_lips-vbeln and&lt;/P&gt;&lt;P&gt;matnr = it_lips-matnr and&lt;/P&gt;&lt;P&gt;bwart   NE  '101'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_lips into wa_lips .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_ekpo into wa_ekpo with key ebeln = wa_lips-vgbel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc = 0.&lt;/P&gt;&lt;P&gt;if wa_lips-bwart ne '101'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_final-aedat = wa_ekpo-aedat.&lt;/P&gt;&lt;P&gt;wa_final-ebeln = wa_lips-vgbel.&lt;/P&gt;&lt;P&gt;wa_final-senp = wa_lips-werks.&lt;/P&gt;&lt;P&gt;wa_final-sen = wa_lips-lgort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_final to it_final.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;Endif.&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;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;otherwise...&lt;/P&gt;&lt;P&gt;loop at it_lips into wa_lips .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_ekpo into wa_ekpo with key ebeln = wa_lips-vgbel.&lt;/P&gt;&lt;P&gt;                                                             &lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;delete it_lips where bwart eq '101'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:54:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302290#M1222830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T05:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302291#M1222831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     In final internal table after appending from workarea delete final internaltable where bwart eq 101, after endloop.&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;vino&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:56:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302291#M1222831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T05:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302292#M1222832</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;Select all the records without giving restriction of 101 movement type.&lt;/P&gt;&lt;P&gt;Then loop the table if any record is movement type 101 then delete it from the table else keep it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 06:03:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302292#M1222832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T06:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302293#M1222833</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;So basically you can have the following example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;VBELV        POSNV    VBELN        POSNN    VBTYP_N BWART

1300000202   000000   10000384     000001   8
1300000202   000010   20070329     100905   Q
1300000202   000010   4900001632   000001   R       641
1300000202   000010   5000000730   000001   i       101&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what you require is for any doc, if it has one entry with bwart 101 (GR), it should not be displayed. Right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If yes, please do as follows (keep your select without the BWART = 101 restriction):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select VBELV bwart matnr from vbfa&lt;/P&gt;&lt;P&gt;into corresponding fields of table it_vbfa&lt;/P&gt;&lt;P&gt;for all entries in it_lips&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;vbelV = it_lips-vbeln and&lt;/P&gt;&lt;P&gt;matnr = it_lips-matnr."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt; loop at it_vbfa into wa_vbfa.&lt;/P&gt;&lt;P&gt;if wa_vbfa-bwart = '101'.&lt;/P&gt;&lt;P&gt;  r_excl_vbelv-sign = 'I'.&lt;/P&gt;&lt;P&gt;  r_excl_vbelv-option = 'EQ'.&lt;/P&gt;&lt;P&gt;  r_excl_vbelv-low = wa_vbfa-vbelv.&lt;/P&gt;&lt;P&gt;  append r_excl_vbelv.&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;if r_excl_vbelv[] is not intial.&lt;/P&gt;&lt;P&gt; delete it_vbfa where vbelv in r_excl_vbelv.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Dev Parbutteea on Mar 18, 2009 7:17 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 06:17:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302293#M1222833</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2009-03-18T06:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302294#M1222834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can do it in the following ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)  select * from ___&lt;/P&gt;&lt;P&gt;                into ____&lt;/P&gt;&lt;P&gt;                where bwart eq '101'.&lt;/P&gt;&lt;P&gt;2)  select * from ___&lt;/P&gt;&lt;P&gt;                into ____&lt;/P&gt;&lt;P&gt;                where bwart in ( '101').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) after the endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete itab where bwart ne '101'.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;kat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 06:19:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302294#M1222834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T06:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302295#M1222835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can loop at your internal table it_vbfa .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbfa into wa_vbfa where bwart = '101'.&lt;/P&gt;&lt;P&gt;DELETE TABLE it_vbfa WITH TABLE KEY VBELV = wa_vbfa-vbelv.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after doing this ur internal table will have only those documents where mov type has never been 101.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 06:34:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302295#M1222835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T06:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302296#M1222836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     Try with Control break events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Sort the it_lips table by vgbel and bwart&lt;/P&gt;&lt;P&gt; 2) In loop and endloop, for every new vgbel, check for bwart value if it is 101, skip complete vgbel.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Note :- It may work only when bwart start with '101' only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT it_lips BY vgbel bwart.

LOOP AT it_lips INTO wa_lips.

AT NEW vgbel.

ENDAT.

  IF wa_lips-bwart = '101'.
    CONTINUE.
  ELSE.

 READ TABLE it_ekpo INTO wa_ekpo WITH KEY ebeln = wa_lips-vgbel.

    IF sy-subrc = 0.

      wa_final-aedat = wa_ekpo-aedat.
      wa_final-ebeln = wa_lips-vgbel.
      wa_final-senp = wa_lips-werks.
      wa_final-sen = wa_lips-lgort.

    ENDIF.

  ENDIF.

AT END OF vgbel.
  APPEND wa_final TO it_final.
ENDAT.

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;Bala Krishna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bala Krishna on Mar 18, 2009 12:31 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 07:01:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302296#M1222836</guid>
      <dc:creator>former_member585060</dc:creator>
      <dc:date>2009-03-18T07:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302297#M1222837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Exactly the same as you mentioned&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iam trying your code...but pls can you help me by saying  wat is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r_excl_vbelv-sign = 'I'.&lt;/P&gt;&lt;P&gt;r_excl_vbelv-option = 'EQ'.&lt;/P&gt;&lt;P&gt;r_excl_vbelv-low = wa_vbfa-vbelv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wat should i declare in data part as????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you so much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 07:12:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302297#M1222837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T07:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: deleting inside a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302298#M1222838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanx krishna for your response&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;but i dont want to check bwart of lips table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;i want to check for vbfa - bwart.......&lt;/STRONG&gt; but it can be specified inside loop at it_lips........&lt;/P&gt;&lt;P&gt;thats the problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 07:21:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-inside-a-loop/m-p/5302298#M1222838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T07:21:30Z</dc:date>
    </item>
  </channel>
</rss>

