Delete Duplicate only

Dear Friends,
I am working On report,
In that i have to delete only duplicate records , ( Delete adjestent duplicate comapring field will delete the entire row)
I dont want to delete entire row just want to show duplicate records empty on the next row.
For EXample
DOc.NO   Customr   Advnce  scheme
1234        11111      1000         400
1234         1111        1000        200
Above doc number customer and advnce fields are having same values and scheme is having differnt value
in that i just want to delete duplicate records in second row  i.e. ( 1234 1111 1000)
Is there any way,
Please help me out.
Regards
Rohan

Hi You can go through the code
READ TABLE T_KONV INTO WA_KONV WITH KEY KNUMV = WA_VBRK-KNUMV
                                        KPOSN = WA_VBRP-POSNR
                                        KSCHL = 'ZOT1' .
IF SY-SUBRC = 0.
       WA_FINAL-KWERT = WA_KONV-KWERT.
ENDIF.
  CLEAR WA_T001W.
  READ TABLE T_T001W  into wa_t001w WITH KEY WERKS = WA_VBRP-WERKS.
  IF SY-SUBRC = 0.
  WA_FINAL-NAME1 = WA_T001W-NAME1.
  ENDIF.
CLEAR wa_t005u.
  READ TABLE t_t005u into wa_t005u with key bland = wa_vbrp-wkreg.
  if sy-subrc = 0.
       wa_final-BEZei = WA_T005U-BEZEI.
endif.
clear wa_kna1.
  READ TABLE t_kna1 into wa_kna1 with key kunnr = wa_vbrk-kunrg.
   IF SY-SUBRC = 0.
   wa_final-Name2 = wa_kna1-name1.
   endif.
   wa_final-kwert = wa_final-kwert * ( -1 ).
  IF wa_final-FKLMG <> 0.
    if sy-subrc = 0.
  wa_final-ADVNCE = WA_FINAL-KWERT / wa_final-FKLMG.
  wa_final-RATE = wa_final-ZRB_ACAMT / wa_final-FKLMG.
  endif.
  endif.
  WA_FINAL-DIFFRENCE = WA_FINAL-KWERT - WA_FINAL-ZRB_ACAMT.
  IF wa_final-VBTYP = '0'.
    if sy-subrc = 0.
    wa_final-fklmg = wa_final-fklmg * ( -1 ).
    wa_final-kwert = wa_final-kwert * ( -1 ).
    endif.
   endif.
  APPEND WA_FINAL TO T_FINAL.
  sort t_final by KWERT.
  CLEAR WA_FINAL.
endloop.
See KWERT is the Advance Given
For Same Document number Advance given will be only once but schemes are two,
I dont want to consider Advance given evry time for each scheme for same document number.
It gives problem while calculating differnce in Advance given and acrrual amount.
I hope u undstand my problem

Similar Messages

  • HT4915 How do I keep iTunes Match from De-Organizing my music? I have spent hours organizing my music ratings, info, and deleting duplicates only to quit iTunes and find out that it reverts back to the original when it starts up and syncs with Match. HELP

    It first de-organized hours worth of my time. Then I tried it again with iTunes match off only to find out that once you turn it on it de-organizes it again!! I have iTunes match turned off on all my devices. HELP

    Go to Settings > iTunes and App Stores and set the option for "iTunes Match" to OFF. Then do a hard reset by holding down the Power and Home buttons until you see the Apple logo.
    FYI, there is no matching from an iOS device.

  • I deleted duplicate files with MacKeeper and now my firefox only shows text. I have reinstalled firefox, java, and checked all of my settings. Any ideas? Safari works fine.

    I deleted duplicate files with MacKeeper and now my firefox only shows text. I have reinstalled firefox, java, and checked all of my settings. Any ideas? Safari works fine.

    I opened iCal back up, all the dates were blank, so i started to type events into a date.
    As soon as I started to double click a date to type an event, magically all the events in all the months reappeared.
    I'm still puzzled why it acted this way and if I did delete something that caused it to act this way.

  • Multiple duplicates, but erasing deletes the only original file?

    HELP? i keep getting multiple duplicates, if i delete any of the duplicates, the original song is deleted in the itunes folder.
    so i am left with a whole bunch of duplicates but no original file. searched everywhere but cant find my music .
    i have now lost 200gb of my 1.5tb 25 year music collection. years of work? what am i doing wrong?
    this is not just cd i can buy again but music i and friends have made

    Command+A selects all items. Command+delete deletes the items, so I suspect it would delete all the files in that window, in other words I don't think it is what you want to do.
    Looking at this another way, there isn't any easy shortcut to deleting duplicates from iTunes.  The best way is to stay on top of duplicates as they are created and change how you do thing in iTunes so you do not create many duplicates.  Oh, there are scripts that will do this, but some things iTunes may say are duplicates are not.  I have one album where there are two tracks with the exact same name and artist but one version is unplugged.  iTunes just tells me they are duplicates.
    How to find and remove duplicate items in your iTunes library - http://support.apple.com/kb/HT2905
    http://dougscripts.com/itunes/itinfo/dupin.php (commercial)
    Posts by turingtest2 about different types of duplicates and techniques- https://discussions.apple.com/thread/3555601 and https://discussions.apple.com/message/16042406 (Note: The DeDuper script is for Windows)

  • Deleting duplicate songs, can't use Robert Jacobson's script (only for PC)

    Help! Is there a script out there that will delete duplicate songs--for mac? Thanks so much

    I'm sorry my script won't work for you!
    Do you realize you are posting in the "iTunes for Windows" forum? Maybe you should ask in the "iTunes for Mac" forum: http://discussions.apple.com/forum.jspa?forumID=789

  • How do you delete duplicate songs in your library without having to delete each song individually??

    How do you delete duplicate songs in your library without having to delete each song individually?

    mauijiminar wrote:
    Go to iTunes, select view and click show duplicates. Hold control and A ( select all) and then delete.
    Not a good idea! The "show duplicates" feature shows "all" duplicate tracks, but you only want to delete the "extra" copies, not the "originals".
    I've written a script called DeDuper which can help remove unwanted duplicates. See this  thread for background, including how to delete the extra tracks manually if you prefer.
    tt2

  • How do I delete duplicate songs, but keep a link in their original albums to the single copy of the song left, so it will play in each album in sequence as if it were still there?

    Greetings!
    After importing my 300 or so CDs into iTunes, I found I have tons of duplicate songs.
    Example: I have a song that came in a original album, then in again in a "Greatest Hits" album, then again in a "Hits of the 80's" album, and again in a soundtrack album. I have now have 4 copies of the exact same song.
    How do I delete duplicate songs, but keep a link in their original albums back to the single copy of the song left, so it will play in each album in sequence as if it were still there?
    I don't think this currently exists, but as my library keeps growing the duplicates keep growing.  It would be nice if Apple sees this and adds a way to link songs to multiple albums.
    I don't want to create a custom playlist for every album that has a duplicate song or two (I'd have dozens of playlists) - thought about fixing it that way but not really practical.

    To my knowledge, there is no way of doing what you want. The only workaround is to create playlists for the other albums containing the track, but that isn't practical for most people.
    You could provide Apple with feedback here: http://www.apple.com/feedback/itunesapp.html

  • How do you delete duplicate photos in the photo section of your iPad?

    How do you delete duplicate photos in the photo section of your iPad?  My iPad has duplicated n tripled my photos n want let me delete them.  I can delete photos from any other section but not in photos, this is taken up all my memory. Help!!

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • How to delete duplicate music in itunes

    I have been downloading a lot of my old CD's and have found I have a lot of duplicate songs from a variety of my album sets...how can I delete them so I only have one of each one?
    thanks!
    Jan

    Dupin may be what you need. If you have the same song as part of different albums then, in my opinion, these aren't really duplicates. Personally I wouldn't throw away some of the tracks on the Beatles "White Album" because I also have them on the "Blue Album".
    For some more thoughts, including tips on how to manually delete duplicates if you have the patience, see this post. It's written from a PC perspective so you may need to use Option or Cmd instead of Shift or Ctrl.
    tt2

  • HOW TO DELETE DUPLICATE ELEMENT IN A VECTOR

    Hi everybody!
    If I've a vector like this vectA={apple,orange,grape,apple,apple,banana}
    and I want final result be vectB={apple,orange,grape,banana}.
    How should I compare each element in vectA and delete duplicate element. Like here duplicated element is apple. Only one apple remain in the vectB.
    Any help,
    Thanks.

    Hello all. Good question and good answers, but I would like to elaborate.
    To begin with, you specifically asked to map the following:
    {apple,orange,grape,apple,apple,banana} ==> {apple,orange,grape,banana}
    Both of cotton.m's solutions do NOT do this, unfortunately. They are both useful in particular cases though, so think about what you're trying to do:
    cotton.m's first solution is best if order does not matter. In fact, as flounder first stated, whenever order doesn't matter, your most efficient bet is to use a Set instead of a List (or Vector) anyways.
    Set vectB = new HashSet(vectA);This code maps to {banana, orange, grape, apple}, because HashSets are "randomly" ordered.
    cotton.m's second solution is good if you want to impose NEW ordering on the List.
    Set vectB = new TreeSet(vectA);This code maps to {apple, banana, grape, orange}, because TreeSet uses alphabetical-order on Strings by default.
    java_2006, your solution is the most correct, but it's a little verbose for my taste :)
    more importantly, the runtime-efficiency is pretty bad (n-squared). calling Vector.contains performs (at worst) n comparisons; you're going to call it n times! Set.contains usually performs 2 comparisons (constant, much better), so I suggest you USE a Set to do the filtering, while still sticking with your good idea to use a List. When the ordering is "arbitrary" (so can't use TreeSet) but still relevant (so can't use HashSet), you're basically talking about a List.
    I think saving A LOT of time is worth using A LITTLE extra space, so here, let's save ourself some runtime, and some carpal-tunnel.
    import java.util.*;
    class Foo {
         public static void main(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List     l = Arrays.asList(fruits),
                   m = filterDups(l);
              System.out.println(m);
         // remember, both of the following methods use O(n) space, but only O(n) time
         static List filterDups(List l) {
              List retVal = new ArrayList();
              Set s = new HashSet();
              for (Object o : l)
                   if (s.add(o))
                        retVal.add(o);     // Set.add returns true iff the item was NOT already present
              return retVal;
         static void killDups(List l) {
              Set s = new HashSet();
              for (Iterator i = l.iterator(); i.hasNext(); )
                   if (! s.add(i.next()))     
                        i.remove();
         // honestly, please don't use Vectors ever again... thanks!
         // if you're going to be a jerk about it, and claim you NEED a Vector result
         // then here's your code, whiner
         public static void mainx(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List l = Arrays.asList(fruits);
              Vector v = new Vector(l);
              killDups(v);
              System.out.println(v);
    }

  • How to delete duplicate records in all tables of the database

    I would like to be able to delete all duplicate records in all the tables of the database. Many of the tables have LONG columns.
    Thanks.

    Hello
    To delete duplicates from an individual table you can use a construct like:
    DELETE FROM
        table_a del_tab
    WHERE
        del_tab.ROWID <> (SELECT
                                MAX(dups_tab.ROWID)
                          FROM
                                table_a dups_tab
                          WHERE
                                dups_tab.col1 = del_tab.col1
                          AND
                                dups_tab.col2 = del_tab.col2
                          )You can then apply this to any table you want. The only differences will be the columns that you join on in the sub query. If you want to look for duplicated data in the long columns themselves, I'm pretty sure you're going to need to do some PL/SQL coding or maybe convert them to blobs or something.
    HTH
    David

  • How to Delete duplicate Records in Table

    CREATE GLOBAL TEMPORARY TABLE MyTable1 (
    Name1 varchar2(100)
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('12');
    insert into MyTable1 values ('12');
    select * from MyTable1
    I want to delete duplicate names from MyTable1..And after delete I should have 11 and 22 only.

    I got the answer
    delete from MyTable1
    where rowid not in
    (select max(rowid)
    from MyTable1
    group by Name1
    having count(1) > 1
    )

  • How to delete duplicate row in certain case

    Hi all,</p>
    <p>I need you help to delete my duplicate row.</p>
    <p>Sample Data in table (<b>table1</b>)</p>
    <p style="margin-top: 0; margin-bottom: 0"> </p>
    <p style="margin-top: 0; margin-bottom: 0"><b>Timein       
    DateIn           
    locationin        useridin       
    status</b></p>
    <p style="margin-top: 0; margin-bottom: 0">08:20:00    01/09/2007       
    0001               
    U01               
    1</p>
    <p style="margin-top: 0; margin-bottom: 0">08:10:30    01/09/2007       
    0004               
    U01               
    1</p>
    <p style="margin-top: 0; margin-bottom: 0">07:20:00    01/09/2007       
    0006               
    U01               
    1</p>
    <p style="margin-top: 0; margin-bottom: 0">08:14:00    01/09/2007       
    0001               
    U02               
    1</p>
    <p style="margin-top: 0; margin-bottom: 0">06:10:30    01/09/2007       
    0004               
    U02               
    1</p>
    <p style="margin-top: 0; margin-bottom: 0">08:10:10    01/09/2007       
    0006               
    U02               
    1</p>
    <p> </p>
    <p>I need to delete the row in table1 and leave the minimum <b>timein</b> in
    that table by <b>useridin</b>.</p>
    <p>The last output in table1 is like below.</p>
    <p style="margin-top: 0; margin-bottom: 0"><b>Timein       
    DateIn           
    locationin        useridin       
    status</b></p>
    <p style="margin-top: 0; margin-bottom: 0">07:20:00    01/09/2007       
    0006               
    U01               
    1</p>
    <p style="margin-top: 0; margin-bottom: 0">06:10:30    01/09/2007       
    0004               
    U02               
    1</p>
    <p>Can i used below  sql to output the result;</p>
    <font FACE="Courier" SIZE="2">
    <p style="margin-top: 0; margin-bottom: 0"></font>
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">delete</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">from</font><font FACE="Courier" SIZE="2">
    <font color="#808000">table1</font> t1 </font>
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">where</font><font FACE="Courier" SIZE="2">
    t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2" COLOR="#ff0000">rowid</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">&gt;</p>
    </font><font FACE="Courier" SIZE="2">
    <p style="margin-top: 0; margin-bottom: 0"></font>
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">(</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">select</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">min(</font><font FACE="Courier" SIZE="2">t2</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2" COLOR="#ff0000">rowID</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">)</font><font FACE="Courier" SIZE="2">
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">from</font><font FACE="Courier" SIZE="2">
    <font color="#808000">table1</font> t2</p>
    <p style="margin-top: 0; margin-bottom: 0"></font>
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">where</font><font FACE="Courier" SIZE="2">
    t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font face="Courier" size="2">Datein
    = t2.Datein</font></p>
    <font FACE="Courier" SIZE="2">
    <p style="margin-top: 0; margin-bottom: 0"></font>
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">and</font><font FACE="Courier" SIZE="2">
    t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2">Status
    </font><font FACE="Courier" SIZE="2" COLOR="#0000ff">=</font><font FACE="Courier" SIZE="2">
    t2</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2">Status</font></p>
    <p style="margin-top: 0; margin-bottom: 0">
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">and</font><font FACE="Courier" SIZE="2">
    t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font>UserIdin
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">=</font><font FACE="Courier" SIZE="2">
    t2</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font>UserIdin
    <font FACE="Courier" SIZE="2" COLOR="#0000ff">order by t2.timein);</font></p>
    <p style="margin-top: 0; margin-bottom: 0"> </p>
    <p style="margin-top: 0; margin-bottom: 0"><font face="Courier" size="2">Thanks
    in advanced

    Hi Rob,
    Just trying to chip in little bit!
    Created Table As follows same as you, only two rows with duplicatem user, datein, and timein:
    create table table1
    as
    select '08:20:00' timein, date '2007-09-01' datein, '0001' locationin, 'U01' useridin, 1 status from dual union all
    select '08:10:30', date '2007-09-01', '0004', 'U01', 1 from dual union all
    select '07:20:00', date '2007-09-01', '0006', 'U01', 1 from dual union all
    select '08:14:00', date '2007-09-01', '0001', 'U02', 1 from dual union all
    select '06:10:30', date '2007-09-01', '0004', 'U02', 1 from dual union all
    select '06:10:30', date '2007-09-01', '0001', 'U02', 1 from dual
    If I run your delete statement result row will be as follows:
    SQL> select * from table1;
    TIMEIN DATEIN LOCA USE STATUS
    07:20:00 01-SEP-07 0006 U01 1
    06:10:30 01-SEP-07 0004 U02 1
    06:10:30 01-SEP-07 0001 U02 1
    Here problem is that its not able to delete duplicate rows having same timein and timeout.
    So I changed you query as follows:
    DELETE FROM tab1
    WHERE rowid NOT IN (
         SELECT     MIN(rowid)
         FROM     tab1
         WHERE     (UseridIn, TO_DATE(TO_CHAR(DateIn,'YYYYMMDD') || TimeIn,'YYYYMMDDHH24:MI:SS')) IN
              (     SELECT     UseridIn, MIN(TO_DATE(TO_CHAR(DateIn,'YYYYMMDD') || timein,'YYYYMMDDHH24:MI:SS'))
                   FROM     tab1
                   GROUP BY UseridIn)
         GROUP BY UseridIn
    If I run your delete statement with little bit of changes, the result row was as follows:
    SQL> select * from table1;
    TIMEIN DATEIN LOCA USE STATUS
    07:20:00 01-SEP-07 0006 U01 1
    06:10:30 01-SEP-07 0004 U02 1
    Regards,
    Raj

  • How to delete duplicate contacts in icloud

    How do you delete duplicate contacts in iCloud so that they will not appear on all of my devices (iPhone, iPad, MacBook)?

    Hey mzhill78
    Remove you icloud contact information on all your IOS devices, go to the icloud setting on you ios device and turn off the addressbook syncing, when it asks you "do you want to remove keep the address on your ips device you say NO...  So now your MacBook is the only thing syncing too the icloud.
    Go to Addresbook and look for the menu option find duplicates.
    After that wait for your laptop to sync this too icloud.  to check give it about 2 min depending on how many changes log into your icloud account at www.icloud.com and check too see if the syncing has updated whats in the cloud.
    If it has then urn on your addressbook syncing in iclouud settings on your IOS devices and all should be back too normal.
    Hope it helps,
    If this has sloved your problem please mark it as Solved thank you..

  • I am trying to delete duplicate photos from events in i=-photo but it deletes the photos entirely from all events including the one I want to keep.  How do I keep the original and delete the duplicates?

    I am trying to delete duplicate photos fron my events in i-photo but it deltes the photo entirely from all events.  How do I keep them in the original events and delte the duplicates without sending them all to the trash?

    Are you referring to Events or Albums?  A photo can exist in one Event only.  However, it can be in multiple albums, books, etc., which uses pointers to the original photo in the Event.  In those cases if you delete the photo from the Event all occurrences of it will be deleted from the library.
    OT

Maybe you are looking for

  • IPod touch 4 requires MAJOR system overhaul.  Major Disappointment!!!!!!!

    Folks, I have a nice iMac that's about 3 years old.  Bought about 2 months before snow leopard, so I've been using 10.4 just fine until recently.  Daughter's iPod bit the dust, and she got a new iPod touch the Fourth.  What a disaster this whole expe

  • Replace function in where clause IN (list)

    DECLARE @DNNo NVARCHAR(15), @InvDNNo NVARCHAR(200) SELECT @DNNo='11-0748-DN01', @InvDNNo='11-0748-DN01,11-0748-DN02,11-0748-DN03,11-0748-DN04' Select 1 Where @DNNo IN (''''+ REPLACE(@InvDNNo,',',''',''') + '''' ) It must be worked as per syntax, but

  • Error message when installing Muse

    Hi I uninstalled the previous version of Muse and tried to download and install the current one, it downloaded 50% and came up with an error Installation Failed, more information: Exit Code: 7 Please see specific errors below for troubleshooting. For

  • Exchange Server 2013: Internal Certificate Issue

    Dear All, I have MS Exchange 2013 with domain name: Exchange.local (fqdn: ex001.exchange.local). I had created the accepted domain for xyz.com. I bought the Wildcard Certificate for *xyz.com. I had issued the certificate to my MS Exchange server. Ext

  • Lost iPhoto Pictures

    Wondering if anyone can help me on this.....last night, I turned on my LaCie hard drive where I store all my photos on iPhoto.  For some reason, a portion of my photo library has disappeared.  The last pictures I have in iPhoto are from July 2009, ev