<?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: Duplicate entries in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618183#M871613</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;May be u r getting the records in the file inorder to insert in the DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inorder to eliminate the duplicate entries, in &lt;STRONG&gt;if&lt;/STRONG&gt; condition u have to compare the keyfields(of record from file)  with the keyfields of the DB table(Keep all the key fields of DB table in one internal table).If the Keyfields matches i.e condition is true then that record is already existing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Mar 2008 06:11:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-24T06:11:24Z</dc:date>
    <item>
      <title>Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618176#M871606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my requirement, i am looping at an internal table and updating the database table for each entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i need to check for duplicate entries i.e if a similar entry is already updated, it should not go ahead.....kindly help me out on how do i go about this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Frank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: frank on Mar 24, 2008 11:34 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:02:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618176#M871606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618177#M871607</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 sort the table and delete adjacent duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SORT pa_gt_update_rows BY ebeln ebelp.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Retain only unique combination of order number and item&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DELETE ADJACENT DUPLICATES FROM pa_gt_update_rows&lt;/P&gt;&lt;P&gt;  COMPARING ebeln ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, Loop at the resultant table and update the Database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Farheen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:07:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618177#M871607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618178#M871608</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;To delete the duplictae entries, Try this&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM &amp;lt;internal table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check this link,&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/06/aafd54fc4011d195280000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/06/aafd54fc4011d195280000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Ruthra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:07:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618178#M871608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618179#M871609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check your internal table whether it has duplicate entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To remove the duplicate entries,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DELETE ADJACENT DUPLICATES FROM &amp;lt;it_tbl&amp;gt; COMPARING &amp;lt;field1&amp;gt; &amp;lt;field2&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps. Rwd points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:07:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618179#M871609</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618180#M871610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Frank.&lt;/P&gt;&lt;P&gt;Use the following&lt;/P&gt;&lt;P&gt;Modify  databse table from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify will only change the entries if they are different otherwise it will have the same copy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:08:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618180#M871610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618181#M871611</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;1. First you remove any duplicates from your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT  ITAB BY  your prinmary key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES BY COMPARING your primary key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.Suppose if all ready existing data may have same like internal table record that time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select single primary key fields into (databasetabel-field1, &lt;/P&gt;&lt;P&gt;                                                         databasetabel-field2,.....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  from database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   data not existed &lt;/P&gt;&lt;P&gt;  ELSE. &lt;/P&gt;&lt;P&gt;      data existed .&lt;/P&gt;&lt;P&gt;    CONTINUE.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Pls. reward if useful....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:10:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618181#M871611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618182#M871612</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;Before loopin thru the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort the internal table based on the key field and then use the statement....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Delete adjacent duplicates  from itab comparing fld1 fld2.........
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where fld1 , fld2 etc are the fields in records which you are updating and you dont want to update them in case there are multiple entries in those fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:10:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618182#M871612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618183#M871613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;May be u r getting the records in the file inorder to insert in the DB table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inorder to eliminate the duplicate entries, in &lt;STRONG&gt;if&lt;/STRONG&gt; condition u have to compare the keyfields(of record from file)  with the keyfields of the DB table(Keep all the key fields of DB table in one internal table).If the Keyfields matches i.e condition is true then that record is already existing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618183#M871613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618184#M871614</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;Above the loop statement you have to sort the internal table by key fields. and delete adjacent duplicates from the internal table comparing the key fields.&lt;/P&gt;&lt;P&gt;With in the loop....endloop you have to update each of database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your question is that if the record already exists it will not be appended again. if this is the case you have to use modify database table from work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:14:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618184#M871614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618185#M871615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Frank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use these statement in end of ur select statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DELETE ADJACENT DUPLICATES FROM itab (Which u given in ur program ) COMPARING FIELD NAME.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample Coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select ekko~ebeln&lt;/P&gt;&lt;P&gt;         ekpo~ebelp&lt;/P&gt;&lt;P&gt;         ekko~bedat&lt;/P&gt;&lt;P&gt;         ekko~lifnr&lt;/P&gt;&lt;P&gt;         ekko~bukrs&lt;/P&gt;&lt;P&gt;         ekpo~txz01&lt;/P&gt;&lt;P&gt;    into table iekko_ekpo&lt;/P&gt;&lt;P&gt;    from ekko&lt;/P&gt;&lt;P&gt;   inner join ekpo&lt;/P&gt;&lt;P&gt;      on ekko&lt;SUB&gt;ebeln = ekpo&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;     for all entries in imkpf_mseg&lt;/P&gt;&lt;P&gt;   where ekko~ebeln = imkpf_mseg-ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT iekko_ekpo BY ebeln ASCENDING&lt;/P&gt;&lt;P&gt;                     bedat DESCENDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; DELETE ADJACENT DUPLICATES FROM iekko_ekpo COMPARING ebeln.*&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear iekko_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it will solve ur problem,kindly give points if it helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By&lt;/P&gt;&lt;P&gt;Pari.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:15:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618185#M871615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618186#M871616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before Deleting U have to short the fiels, untill n unless it will not work. Then use DELETE ADJACENT DUPLICATES ...comparing ur shorted fields. Try this it will work!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 06:21:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries/m-p/3618186#M871616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-24T06:21:43Z</dc:date>
    </item>
  </channel>
</rss>

