<?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: Compare records in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593040#M865156</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Internal table itab has following data:&lt;/P&gt;&lt;P&gt;Field1 Field2&lt;/P&gt;&lt;P&gt;A 100&lt;/P&gt;&lt;P&gt;A 200&lt;/P&gt;&lt;P&gt;B 300&lt;/P&gt;&lt;P&gt;C 400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: counter  type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by field1 field2.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  at new field1.&lt;/P&gt;&lt;P&gt;    clear counter.&lt;/P&gt;&lt;P&gt;  endat&lt;/P&gt;&lt;P&gt;   counter = counter + 1.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; at end of field1.&lt;/P&gt;&lt;P&gt;  move itab-field1 to itab1-field1.&lt;/P&gt;&lt;P&gt;  move counter to itab1-counter.&lt;/P&gt;&lt;P&gt;  append itab1.&lt;/P&gt;&lt;P&gt; endat.&lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1 will now contain&lt;/P&gt;&lt;P&gt;A 2&lt;/P&gt;&lt;P&gt;B 1&lt;/P&gt;&lt;P&gt;C 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Apr 2008 09:50:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-02T09:50:42Z</dc:date>
    <item>
      <title>Compare records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593038#M865154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   This is very urgent, i need to compare two records of an internal table and then add one counter to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filed1               Field2&lt;/P&gt;&lt;P&gt;A                         100&lt;/P&gt;&lt;P&gt;A                         200&lt;/P&gt;&lt;P&gt;B                         300&lt;/P&gt;&lt;P&gt;C                         400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i have to set a counter for field1 and for A the value of the counter would be 2. For B and C it would be 1. Can you suggest how to do that? It is really urgent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:41:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593038#M865154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Compare records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593039#M865155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if field1 = 'A'.&lt;/P&gt;&lt;P&gt;add 1 to counter_a.&lt;/P&gt;&lt;P&gt;elseif field1 = 'B'.&lt;/P&gt;&lt;P&gt;add  to counter_b.&lt;/P&gt;&lt;P&gt;elseif field1 = 'C'.&lt;/P&gt;&lt;P&gt;add 1 to counter_c.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:48:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593039#M865155</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-04-02T09:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Compare records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593040#M865156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Internal table itab has following data:&lt;/P&gt;&lt;P&gt;Field1 Field2&lt;/P&gt;&lt;P&gt;A 100&lt;/P&gt;&lt;P&gt;A 200&lt;/P&gt;&lt;P&gt;B 300&lt;/P&gt;&lt;P&gt;C 400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: counter  type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by field1 field2.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  at new field1.&lt;/P&gt;&lt;P&gt;    clear counter.&lt;/P&gt;&lt;P&gt;  endat&lt;/P&gt;&lt;P&gt;   counter = counter + 1.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; at end of field1.&lt;/P&gt;&lt;P&gt;  move itab-field1 to itab1-field1.&lt;/P&gt;&lt;P&gt;  move counter to itab1-counter.&lt;/P&gt;&lt;P&gt;  append itab1.&lt;/P&gt;&lt;P&gt; endat.&lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1 will now contain&lt;/P&gt;&lt;P&gt;A 2&lt;/P&gt;&lt;P&gt;B 1&lt;/P&gt;&lt;P&gt;C 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:50:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593040#M865156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Compare records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593041#M865157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   There is not only 3 values , there is a around 1000 values, i cant hardcode all of them, i need to compare between the two adjacent rows, i need a logic for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:50:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593041#M865157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compare records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593042#M865158</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;You must already have a counter by different value that you have in the table or you know what king of value you will have?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can sort you table by A and use the event AT :&lt;/P&gt;&lt;P&gt;AT - itab &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;LOOP AT itab result ... &lt;/P&gt;&lt;P&gt;  [AT FIRST. &lt;/P&gt;&lt;P&gt;     ... &lt;/P&gt;&lt;P&gt;   ENDAT.] &lt;/P&gt;&lt;P&gt;    [AT NEW comp1. &lt;/P&gt;&lt;P&gt;       ... &lt;/P&gt;&lt;P&gt;     ENDAT. &lt;/P&gt;&lt;P&gt;       [AT NEW comp2. &lt;/P&gt;&lt;P&gt;         ... &lt;/P&gt;&lt;P&gt;       ENDAT. &lt;/P&gt;&lt;P&gt;         [...]]] &lt;/P&gt;&lt;P&gt;           [ ... ] &lt;/P&gt;&lt;P&gt;       [[[...] &lt;/P&gt;&lt;P&gt;       AT END OF comp2. &lt;/P&gt;&lt;P&gt;         ... &lt;/P&gt;&lt;P&gt;       ENDAT.] &lt;/P&gt;&lt;P&gt;     AT END OF comp1. &lt;/P&gt;&lt;P&gt;       ... &lt;/P&gt;&lt;P&gt;     ENDAT.] &lt;/P&gt;&lt;P&gt;  [AT LAST. &lt;/P&gt;&lt;P&gt;     ... &lt;/P&gt;&lt;P&gt;  ENDAT.] &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then do the same thing with sorting by B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:52:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593042#M865158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Compare records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593043#M865159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With the DELETE ADJACENT DUPLICATES FROM itab comparing A or B. you will have all distinct value.&lt;/P&gt;&lt;P&gt;I suggest that you keep your internal table as counter where you will put the value counter next of the original value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-records/m-p/3593043#M865159</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:57:18Z</dc:date>
    </item>
  </channel>
</rss>

