<?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: helpppppp in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506459#M843356</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;First sort ur internal table &lt;/P&gt;&lt;P&gt;and then use delete adjacent duplicates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from itab comparing field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Mar 2008 11:24:00 GMT</pubDate>
    <dc:creator>former_member386202</dc:creator>
    <dc:date>2008-03-11T11:24:00Z</dc:date>
    <item>
      <title>helpppppp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506457#M843354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i make new tread hoping that i could get new response&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a an internal table with 10 field (field1, field2, field3 ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to retreive duplicate record as per the the first 5 field (that is by field 1 , 2 ,3 , 4 , 5) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i don't want to use at new or at end&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 11:14:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506457#M843354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-11T11:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: helpppppp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506458#M843355</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 ADJACENT DUPLICATES FROM itab&lt;/P&gt;&lt;P&gt;COMPARING f1 .. fn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system deletes all adjacent entries with the same key field contents apart from the first entry. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can prevent the system from only comparing the key field using the COMPARING addition. If you sort&lt;/P&gt;&lt;P&gt;the table by the required fields beforehand, you can be sure that only unique entries will remain in the&lt;/P&gt;&lt;P&gt;table after the DELETE ADJACENT DUPLICATES statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this in your code, and compare the work area and the internal table. Pass the fields you want to compare in comparing syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the COMPARING addition, the system compares the field contents of a data record with those in the&lt;/P&gt;&lt;P&gt;work area for equality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this helps, Do reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Runal Singh on Mar 11, 2008 4:51 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Runal Singh on Mar 11, 2008 4:52 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 11:20:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506458#M843355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-11T11:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: helpppppp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506459#M843356</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;First sort ur internal table &lt;/P&gt;&lt;P&gt;and then use delete adjacent duplicates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from itab comparing field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 11:24:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506459#M843356</guid>
      <dc:creator>former_member386202</dc:creator>
      <dc:date>2008-03-11T11:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: helpppppp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506460#M843357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let the internal table u have with u be itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data itab2 like table of itab1 with header line.&lt;/P&gt;&lt;P&gt;Data itab3 like table of itab1 with header line.&lt;/P&gt;&lt;P&gt;itab2[] = itab1[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab2 by field1 field2 field3 field4 field5.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from itab2 comparing field1 field2 field3 field4 field5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read table itab2 with key field1 = itab1-field1&lt;/P&gt;&lt;P&gt;                                    field2 = itab1-field2&lt;/P&gt;&lt;P&gt;                                    field3 = itab1-field3&lt;/P&gt;&lt;P&gt;                                    field4 = itab1-field4&lt;/P&gt;&lt;P&gt;                                    field5 = itab1-field5.&lt;/P&gt;&lt;P&gt;if sy-subrc =0.&lt;/P&gt;&lt;P&gt;append itab1 to itab3.&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;*Now we have the duplicate entries in itab3...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Arjun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 11:25:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506460#M843357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-11T11:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: helpppppp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506461#M843358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort itab by f1 f2 f3 f4 f5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  v_counter = v_counter + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  If v_counter = 1.&lt;/P&gt;&lt;P&gt;    itab1 = itab.  &lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  If v_counter &amp;gt; 1.&lt;/P&gt;&lt;P&gt;    if itab-f1 = itab1-f1 and&lt;/P&gt;&lt;P&gt;      itab-f2 = itab1-f2 and&lt;/P&gt;&lt;P&gt;      itab-f3 = itab1-f3 and&lt;/P&gt;&lt;P&gt;      itab-f4 = itab1-f4 and&lt;/P&gt;&lt;P&gt;      itab-f5 = itab1-f5.&lt;/P&gt;&lt;P&gt;     itab3 = itab.&lt;/P&gt;&lt;P&gt;     append itab3.&lt;/P&gt;&lt;P&gt;     clear  itab3.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;       clear: itab1 , v_counter.&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;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab3 has duplicate records ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 11:28:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506461#M843358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-11T11:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: helpppppp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506462#M843359</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 can do as below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"Declare two internal tables similar to actual internal table.

itab2 [] = itab1 [].

sort itab1 by f1 f2 f3 f4 f5.

sort itab2 by f1 f2 f3 f4 f5.

loop at itab1.

read table itab2 with key f1 = itab1-f1
                                    f2 = itab1-f2
                                    f3 = itab1-f3
                                    f4 = itab1-f4
                                    f5 = itab1-f5.

if sy-subrc eq 0.
  itab3 = itab1.
  append itab3.
  clear itab3.
endif.

endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 11:29:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506462#M843359</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-11T11:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: helpppppp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506463#M843360</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;Check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT itab BY f1 f2 f3 f4 f5.&lt;/P&gt;&lt;P&gt;LOOP AT i_tab INTO wa_tab.&lt;/P&gt;&lt;P&gt;CLEAR w_value.&lt;/P&gt;&lt;P&gt;w_value = wa_tab-f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHECK wa_tab-f1 EQ w_value&lt;/P&gt;&lt;P&gt;AND wa_tab-f2 EQ w_value&lt;/P&gt;&lt;P&gt;AND wa_tab-f3 EQ w_value&lt;/P&gt;&lt;P&gt;AND wa_tab-f4 EQ w_value&lt;/P&gt;&lt;P&gt;AND wa_tab-f5 EQ w_value.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Do ur processing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I sugest u to go with first solution which is more efficient and proper.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vinod Kumar Vemuru on Mar 11, 2008 5:03 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 11:30:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506463#M843360</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-03-11T11:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: helpppppp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506464#M843361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hye..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  This can be achieved using a loop inside a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create an internal table with the fields u want to compare.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_compare,&lt;/P&gt;&lt;P&gt;       fld1....&lt;/P&gt;&lt;P&gt;       fld2...&lt;/P&gt;&lt;P&gt;       end of it_compare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;itab is the original table from which data is collected and it_out is the table which has the duplicate entries collection.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;move-corresponding itab[] to it_compare.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;  loop at it_compare into wa_compare.&lt;/P&gt;&lt;P&gt;     if ( wa_compare-fld1 = wa-fld1and&lt;/P&gt;&lt;P&gt;       wa_compare-fld2 = wa-fld2 and...)&lt;/P&gt;&lt;P&gt;       count = count + 1.&lt;/P&gt;&lt;P&gt;     endif.&lt;/P&gt;&lt;P&gt;    if count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;     append wa into it_out.&lt;/P&gt;&lt;P&gt;     exit.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this works, reward if found helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Imran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 11:49:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/helpppppp/m-p/3506464#M843361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-11T11:49:34Z</dc:date>
    </item>
  </channel>
</rss>

