<?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: Duplicates From Internal Tabl in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737609#M320728</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;  if itab1-field1 = itab1-field2.&lt;/P&gt;&lt;P&gt;  if itab1-field1 = itab1-field3.&lt;/P&gt;&lt;P&gt;  if itab1-field1 = itab1-field4.&lt;/P&gt;&lt;P&gt;  if itab1-field1 = itab1-field5.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab2.&lt;/P&gt;&lt;P&gt;    append itab2.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab3.&lt;/P&gt;&lt;P&gt;    append itab3.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab3.&lt;/P&gt;&lt;P&gt;    append itab3.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab3.&lt;/P&gt;&lt;P&gt;    append itab3.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab3.&lt;/P&gt;&lt;P&gt;    append itab3.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  clear: iatb1, itab2, itab3.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Ramesh Babu Chirumamilla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Dec 2006 14:53:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-05T14:53:51Z</dc:date>
    <item>
      <title>Duplicates From Internal Tabl</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737606#M320725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an internal table with 6 fields and if the first five fields are same then its called a dublicate and I shud collect these duplicates in an other table moving the original to the other internal table. So from the basic Internal table I need to form 2 tables one with originals and the other with duplicates..How do i do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Viky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 14:48:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737606#M320725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T14:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicates From Internal Tabl</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737607#M320726</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;Say itab is your first table and&lt;/P&gt;&lt;P&gt;    itab2 is table of the same type as itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_itab and wa_itab are work areas of the type of your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt;clear cnt.&lt;/P&gt;&lt;P&gt;Loop at itab into wa_itab1 where field1 = wa_itab-field1&lt;/P&gt;&lt;P&gt;                                               field2 = wa_itab-field2&lt;/P&gt;&lt;P&gt;                                               field3 = wa_itab-field3&lt;/P&gt;&lt;P&gt;                                               field4 = wa_itab-field4&lt;/P&gt;&lt;P&gt;                                               field5 = wa_itab-field5&lt;/P&gt;&lt;P&gt;cnt = cnt + 1.&lt;/P&gt;&lt;P&gt;If cnt gt 1.&lt;/P&gt;&lt;P&gt;append wa_itab1 to itab2.&lt;/P&gt;&lt;P&gt;DELETE itab from wa_itab1.&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>Tue, 05 Dec 2006 14:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737607#M320726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T14:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicates From Internal Tabl</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737608#M320727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;take two internal tables and both should be a copy of the original table.&lt;/P&gt;&lt;P&gt;in one table delete adjacent duplicates comparing the necessary fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next loop at the original internal table . read the table in which duplicates are deleted. delete the third table if there are entries in second table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 14:53:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737608#M320727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T14:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicates From Internal Tabl</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737609#M320728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;  if itab1-field1 = itab1-field2.&lt;/P&gt;&lt;P&gt;  if itab1-field1 = itab1-field3.&lt;/P&gt;&lt;P&gt;  if itab1-field1 = itab1-field4.&lt;/P&gt;&lt;P&gt;  if itab1-field1 = itab1-field5.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab2.&lt;/P&gt;&lt;P&gt;    append itab2.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab3.&lt;/P&gt;&lt;P&gt;    append itab3.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab3.&lt;/P&gt;&lt;P&gt;    append itab3.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab3.&lt;/P&gt;&lt;P&gt;    append itab3.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    move corresponding fields of itab1 to itab3.&lt;/P&gt;&lt;P&gt;    append itab3.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  clear: iatb1, itab2, itab3.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Ramesh Babu Chirumamilla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 14:53:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737609#M320728</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T14:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicates From Internal Tabl</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737610#M320729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;suppose say fld1 , fld2 ,fld3 , fld4 fld5 , fld6  are ur fields

sort itab by fld1 fld2 fld3 fld4 fld5 fld6 

loop at itab.

   at new fld5.
      read table itab index sy-tabix.
     move-corresponding itab to itab1.
     append itab1.
     delete table itab index sy-tabix.
  endat.

endat.


now

itab1  will contain the originals
itab will contain the duplicates&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 14:56:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737610#M320729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T14:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicates From Internal Tabl</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737611#M320730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;data: ind like sy-tabix.
itab_orig[] = itab[].
sort itab by fld1 fld2 fld3 fld4 fld5.
delete adjacent duplicates from itab comparing fld1 fld2 fld3 fld4 fld5.
loop at itab into wa.
   ind = sy-tabix.
   loop at itab from into wa_tab 
        where fld1 = fld1
        and   fld2 = fld2
        and   fld3 = fld3
        and   fld4 = fld4
        and   fld5 = fld5.
        check sy-tabix gt ind.
        append wa_tab to itab_dup.
        delete itab from wa_tab.
   endloop.
   delete itab.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, i guess itab_orig should be holding the originals and itab_dup holding duplicate entries.&lt;/P&gt;&lt;P&gt;Please check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 15:05:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicates-from-internal-tabl/m-p/1737611#M320730</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T15:05:42Z</dc:date>
    </item>
  </channel>
</rss>

