<?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: logic needed in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740108#M636573</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;&lt;/P&gt;&lt;P&gt; use collect statement. it will sum  up all numeric fields if the records are having same fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;collect itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/10 itab-fld.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if helpful reward some points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;Suresh Aluri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Sep 2007 09:53:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-03T09:53:21Z</dc:date>
    <item>
      <title>logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740103#M636568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have an internal table with the following values .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1     field2     field3      field4&lt;/P&gt;&lt;P&gt;123        50         20          abc&lt;/P&gt;&lt;P&gt;123        60         50          eee&lt;/P&gt;&lt;P&gt;123        70         90          rrrr&lt;/P&gt;&lt;P&gt;124        50         80         ggg&lt;/P&gt;&lt;P&gt;124        90         20          ggh&lt;/P&gt;&lt;P&gt;125        50         80          nnn&lt;/P&gt;&lt;P&gt;125        30         20          mm&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the above table &lt;/P&gt;&lt;P&gt;i need to display field4 for the below condition.&lt;/P&gt;&lt;P&gt;for same entry in field1 i should sum field2&amp;amp;field3 and get the highest value.&lt;/P&gt;&lt;P&gt;display field4 which has the highest value.(sum of field2&amp;amp;3)&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 in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 09:22:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740103#M636568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T09:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740104#M636569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: begin of tab1 occurs 0,&lt;/P&gt;&lt;P&gt;            field1(3),&lt;/P&gt;&lt;P&gt;            field2 type i,&lt;/P&gt;&lt;P&gt;            field3 type i,&lt;/P&gt;&lt;P&gt;            field4(3),&lt;/P&gt;&lt;P&gt;         end of tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of tab2 occurs 0,&lt;/P&gt;&lt;P&gt;            field1(3),&lt;/P&gt;&lt;P&gt;            field5 type i,&lt;/P&gt;&lt;P&gt;            field4(3),&lt;/P&gt;&lt;P&gt;         end of tab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at tab1.&lt;/P&gt;&lt;P&gt;  tab2-field1 = tab1-field1.&lt;/P&gt;&lt;P&gt;  tab2-field5 = tab1-field2 + tab1-field3.&lt;/P&gt;&lt;P&gt;  tab2-field4 = tab1-field4.&lt;/P&gt;&lt;P&gt;  append tab2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort tab2 by field1 ascending and field5 descending.&lt;/P&gt;&lt;P&gt;delete adjacent-duplicates from itab2 comparing field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result is what u requires.&lt;/P&gt;&lt;P&gt;hope this helps,&lt;/P&gt;&lt;P&gt;reward if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 09:34:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740104#M636569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T09:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740105#M636570</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;Code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add a new field field5 of type field2/3 in the same table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field5 = field2 + field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY tab1.&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;field1   field2   field3   field4   field5&lt;/P&gt;&lt;P&gt;123     50       20       abc      70&lt;/P&gt;&lt;P&gt;123     60       50       eee      110&lt;/P&gt;&lt;P&gt;123     70       90       rrrr       160&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT tab1 BY field1 field5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1   field2   field3   field4   field5&lt;/P&gt;&lt;P&gt;123     70       90       rrrr       160&lt;/P&gt;&lt;P&gt;123     60       50       eee      110&lt;/P&gt;&lt;P&gt;123     50       20       abc      70&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES COMPARING field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1   field2   field3   field4   field5&lt;/P&gt;&lt;P&gt;123     70       90       rrrr       160&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Vikas Bittera.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ou will get something like&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 09:37:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740105#M636570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T09:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740106#M636571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont want to delete the other records,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i sum the two fields to get the highest total and corresponing field4 is taken&lt;/P&gt;&lt;P&gt;then for th same entry in field one all the field2 and field 3 are added and displayed./&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1   field2   field3   field4   &lt;/P&gt;&lt;P&gt;123     50       20       abc      &lt;/P&gt;&lt;P&gt;123     60       50       eee      &lt;/P&gt;&lt;P&gt;124    70       100       rgg      &lt;/P&gt;&lt;P&gt;124    70       90       rrrr  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the o/p should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;123  110  70    eee (sum field2&amp;amp;3)  field 4 base don the highest total of f3&amp;amp;4&lt;/P&gt;&lt;P&gt;124  140  190   rgg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 09:45:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740106#M636571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T09:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740107#M636572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balaji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;        FIELD1 TYPE I,&lt;/P&gt;&lt;P&gt;        FIELD2 TYPE I,&lt;/P&gt;&lt;P&gt;        FIELD3 TYPE I,&lt;/P&gt;&lt;P&gt;        FIELD4(4) TYPE C,&lt;/P&gt;&lt;P&gt;      END OF ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: V_COUNT TYPE I,&lt;/P&gt;&lt;P&gt;      V_COUNT1 TYPE I,&lt;/P&gt;&lt;P&gt;      V_TEXT(4) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-FIELD1 = 123.&lt;/P&gt;&lt;P&gt;ITAB-FIELD2 = 50.&lt;/P&gt;&lt;P&gt;ITAB-FIELD3 = 20.&lt;/P&gt;&lt;P&gt;ITAB-FIELD4 = 'abc'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-FIELD1 = 123.&lt;/P&gt;&lt;P&gt;ITAB-FIELD2 = 60.&lt;/P&gt;&lt;P&gt;ITAB-FIELD3 = 50.&lt;/P&gt;&lt;P&gt;ITAB-FIELD4 = 'eee'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-FIELD1 = 123.&lt;/P&gt;&lt;P&gt;ITAB-FIELD2 = 70.&lt;/P&gt;&lt;P&gt;ITAB-FIELD3 = 90.&lt;/P&gt;&lt;P&gt;ITAB-FIELD4 = 'rrrr'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-FIELD1 = 124.&lt;/P&gt;&lt;P&gt;ITAB-FIELD2 = 50.&lt;/P&gt;&lt;P&gt;ITAB-FIELD3 = 80.&lt;/P&gt;&lt;P&gt;ITAB-FIELD4 = 'ggg'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-FIELD1 = 124.&lt;/P&gt;&lt;P&gt;ITAB-FIELD2 = 90.&lt;/P&gt;&lt;P&gt;ITAB-FIELD3 = 20.&lt;/P&gt;&lt;P&gt;ITAB-FIELD4 = 'ggh'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-FIELD1 = 124.&lt;/P&gt;&lt;P&gt;ITAB-FIELD2 = 50.&lt;/P&gt;&lt;P&gt;ITAB-FIELD3 = 80.&lt;/P&gt;&lt;P&gt;ITAB-FIELD4 = 'nnn'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-FIELD1 = 124.&lt;/P&gt;&lt;P&gt;ITAB-FIELD2 = 30.&lt;/P&gt;&lt;P&gt;ITAB-FIELD3 = 20.&lt;/P&gt;&lt;P&gt;ITAB-FIELD4 = 'mm'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  V_COUNT = ITAB-FIELD2 + ITAB-FIELD3.&lt;/P&gt;&lt;P&gt;  IF V_COUNT &amp;gt; V_COUNT1.&lt;/P&gt;&lt;P&gt;    V_COUNT1 = V_COUNT.&lt;/P&gt;&lt;P&gt;    V_TEXT = ITAB-FIELD4.&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;WRITE:/ V_TEXT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 09:48:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740107#M636572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T09:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740108#M636573</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;&lt;/P&gt;&lt;P&gt; use collect statement. it will sum  up all numeric fields if the records are having same fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;collect itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/10 itab-fld.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if helpful reward some points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;Suresh Aluri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 09:53:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740108#M636573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T09:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740109#M636574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HERE THE OUTPUT IS 'RRR'.&lt;/P&gt;&lt;P&gt;WHAT ABT THE OTHERS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 09:55:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740109#M636574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T09:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740110#M636575</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;Here is the required logic. just you need to check the syntax in delete and  need to define some local variables used below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;loop at itab where itab-field1 = field1.&lt;/P&gt;&lt;P&gt;index = sy-tabix.&lt;/P&gt;&lt;P&gt;itab-field4 = itab-field2 + itab-field3.&lt;/P&gt;&lt;P&gt;modify itab index index transporting field4.&lt;/P&gt;&lt;P&gt;if itab-field4 &amp;gt; field.&lt;/P&gt;&lt;P&gt;field  = itab-field4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;delete table itab where field4 &amp;lt;&amp;gt; field and field1 = itab-field1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 09:58:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740110#M636575</guid>
      <dc:creator>sushant_singh</dc:creator>
      <dc:date>2007-09-03T09:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740111#M636576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you do not want to delete other record then just omit the delete statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 10:00:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740111#M636576</guid>
      <dc:creator>sushant_singh</dc:creator>
      <dc:date>2007-09-03T10:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740112#M636577</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;Code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add a new field field5 of type field2/3 in the same table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field5 = field2 + field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY tab1.&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;field1 field2 field3 field4 field5&lt;/P&gt;&lt;P&gt;123 50 20 abc 70&lt;/P&gt;&lt;P&gt;123 60 50 eee 110&lt;/P&gt;&lt;P&gt;123 70 90 rrrr 160&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT tab1 BY field1 field5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1 field2 field3 field4 field5&lt;/P&gt;&lt;P&gt;123 70 90 rrrr 160&lt;/P&gt;&lt;P&gt;123 60 50 eee 110&lt;/P&gt;&lt;P&gt;123 50 20 abc 70&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create another table with only field1, 2 and 3..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab2-field1 = tab1-field1.&lt;/P&gt;&lt;P&gt;tab2-field2 = tab1-field2.&lt;/P&gt;&lt;P&gt;tab2-field3 = tab1-field3.&lt;/P&gt;&lt;P&gt;COLLECT tab2.&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;Tab2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1 field2 field3&lt;/P&gt;&lt;P&gt;123    180   160&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM tab1 COMPARING field1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE tab2 WITH key field1 = tab1-field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab1-field1 = tab2-field1.&lt;/P&gt;&lt;P&gt;tab1-field2 = tab2-field2.&lt;/P&gt;&lt;P&gt;tab1-field3 = tab2-field3.&lt;/P&gt;&lt;P&gt;MODIFY tab1.&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;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Vikas Bittera.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 10:07:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/2740112#M636577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T10:07:50Z</dc:date>
    </item>
  </channel>
</rss>

