<?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: Table maintenance in a loop? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892963#M53734</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will do&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
read table reference with key key = itab_mstr-key
                              OFS = itab_mstr-OFS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Mar 2005 14:36:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-03-18T14:36:18Z</dc:date>
    <item>
      <title>Table maintenance in a loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892958#M53729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a situation that I'm having trouble resolving.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looping through this list, each time getting a table of keys and offsets. But each time I loop through it, I only want to retain the records that are common and get rid of new or unique records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm thinking the code should be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab1.
  call function ...
     exporting
        e_result = reference []
  if count = 0.
     master_list = reference.
     count = count + 1.
  ELSE.
     DELETE FROM MASTER_LIST WHERE RECORDS DON'T MATCH UP IN reference. ???
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help out,&lt;/P&gt;&lt;P&gt;Natasha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2005 14:02:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892958#M53729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-18T14:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Table maintenance in a loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892959#M53730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not the prettiest way of doing it, but here is a sample program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0002 .


data: begin of itab occurs 0,
      field1 type c,
      field2 type c,
      field3 type c,
      end of itab.


start-of-selection.


  itab-field1 = 'A'.
  itab-field2 = 'B'.
  itab-field3 = 'C'.
  append itab.
  append itab.

  itab-field1 = 'C'.
  itab-field2 = 'D'.
  itab-field3 = 'E'.
  append itab.

  itab-field1 = 'F'.
  itab-field2 = 'G'.
  itab-field3 = 'H'.
  append itab.
  append itab.


  data: counter type i.

  loop at itab.

    clear counter.
    loop at itab where field1 = itab-field1.
      counter =  counter + 1.
    endloop.

    if counter =  1.
      delete itab.
      continue.
    endif.

  endloop.

  check sy-subrc  = 0.

&lt;/CODE&gt;&lt;/PRE&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>Fri, 18 Mar 2005 14:17:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892959#M53730</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-18T14:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Table maintenance in a loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892960#M53731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Natasha, when i read your problem i understand that you wanna do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab1.
  call function ...
     exporting
        e_result = reference []
  if count = 0.
     master_list = reference.
     count = count + 1.
  ELSE.

**-
 loop at master_list.
  read table reference with key FIELD = master_list-field.
   if sy-subrc &amp;lt;&amp;gt; 0.
    delete master_list.
   endif.
 endloop.
**-

  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what are you looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Carlos A. Lerzundy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2005 14:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892960#M53731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-18T14:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Table maintenance in a loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892961#M53732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I enable the read to check multiple fields.&lt;/P&gt;&lt;P&gt;Both reference and master_list have fields KEY and OFFSET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when I want to check that both fields are equal in the condition, how do I do this (syntactically)? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;read: table reference with key key = itab_mstr-key, OFS = itab_mstr-OFS.  &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2005 14:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892961#M53732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-18T14:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Table maintenance in a loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892962#M53733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;read table reference with key key = itab_mstr-key
                              OFS = itab_mstr-OFS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that I have misunderstood your requirment.&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>Fri, 18 Mar 2005 14:35:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892962#M53733</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-18T14:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Table maintenance in a loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892963#M53734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will do&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
read table reference with key key = itab_mstr-key
                              OFS = itab_mstr-OFS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2005 14:36:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-in-a-loop/m-p/892963#M53734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-18T14:36:18Z</dc:date>
    </item>
  </channel>
</rss>

