Problem in delete adjecent duplicates

Hi All,
i have a problem in delete adjacent duplicate in an internal table .
when  i use it i want that the records which are getting doubled to be removed
but i also want that if the value in that field is empty for which i am comparing , to be ignored means i dont want the records
to be deleted in which the field value is empty for which i am comparing.
snippet of my code
delete ADJACENT DUPLICATES FROM xkomv COMPARING KSCHL.
so if theere is no value in KSCHL THAT RECORD NOT TO BE DELETED .
waiting for your reply..
Thanks in advance

Try the following,
"delete ADJACENT DUPLICATES FROM xkomv COMPARING KSCHL.
Before using the above statement do the following,
u201C decalare a temporary table for u2018xkomvu2019 say u2018t_xkomvu2019, and copy the data.
Refresh t_xkomv[].
t_xkomv[] = xkomv[].
Delete t_xkomv where KSCHL <> u2018  u2018.
Delete xkomv where KSCHL =  u2018  u2018.
u201C Sort xkomv and then use delete adjacent duplicates.
And after this append data from t_xkomv to xkomv.
Hope it helps you,
Regards,
Abhijit G. Borkar

Similar Messages

  • Problem using DELETE ADJACENT DUPLICATES with dynamic table

    Hello All,
       In my program i have to delete duplicate records from dynamic table.
    I tried using  DELETE ADJACENT DUPLICATES FROM <DYN_TABLE> COMPARING <fieldname1> <fieldname2> but it fails in syntax check, then i tried like below:
      DATA string type string.
      string = '<fieldname1> <fieldname2>.........'.
      DELETE ADJACENT DUPLICATES FROM <DYN_TABLE> COMPARING (string).
    It also got failed at runtime.
    Please suggest how can i achieve this....
    Regards
    Munish Garg

    Hi,
    this code is worked truly.
    You can try this.
    Regards.
    DATA itab LIKE STANDARD TABLE OF mard.
    SELECT * FROM mard INTO TABLE itab UP TO 100 ROWS.
    * You define max number of the field that you need
    data : cmp01  TYPE string,
    cmp02 TYPE string,
    cmp03 TYPE string,
    cmp04 TYPE string,
    cmp05 TYPE string.
    * You fill the fields that you need, others is clear.
    cmp01  = 'MATNR'.
    cmp02 = 'WERKS'.
    CLEAR : cmp03,cmp04,cmp05.
    SORT itab BY (cmp01) (cmp02) (cmp03) (cmp04) (cmp05).
    DELETE ADJACENT DUPLICATES FROM itab COMPARING (cmp01) (cmp02) (cmp03)
    (cmp04) (cmp05).

  • HT201210 Contact List Problem.   I have duplicates on my iPhone.  I turned off my Contact and selected "Delete Contacts"  Most of the contacts were deleted but about 120 were left on my phone.   I've tried selecting individual contacts and deleting them,

    Contact List Problem.   I have duplicates on my iPhone.  I turned off my Contact and selected "Delete Contacts"  Most of the contacts were deleted but about 120 were left on my phone.   I've tried selecting individual contacts and deleting them, No Go. 
    Can anyone help?   How do I get rid of these contacts so I can re-synch my iPhone. 

    I have exactly the same problem on my ipad. It is happening on only some contacts but, as with you, when I delete one of the contacts on the ipad, the second ipad contact and the contact on the imac are also deleted. This is even the case when I have differentiated the two contacts on the ipad and can see the one I have deleted on the ipad is not the same one as is then deleted on the imac.

  • HT2905 Is there a way to automatically delete exact duplicates in iTunes 11

    Has anyone found a way to automatically delete Exact Duplicates from iTunes 11.  As I read the instructions, it can only be done by comparing the songs with the same title, making sure that it is the same album, etc.  Then I have been going through the duplicates and pressing CTRL in Windows to select the next duplicate song to delete.  I have a very large library and this is going to take hours.
    I guess I didn't get the instructions correctly when I backed up my Library to move from an old laptop to a new one.  I am going to have to go back and read those again because this brand new HP is having problems like the past few that I have received from HP.  I will never recommend an HP Product, I can tell you that.
    Thanks to all for reading this and I hope someone has an answer to automate it.

    When deduping use Shift > View > Show Exact Duplicate Items as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks. If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin. Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    See also HT2905: How to find and remove duplicate items in your iTunes library.
    (Duplicate link)
    If you still have the original library on the old laptop see this  migrate iTunes library post. It may be easier and/or better to redo the transfer...
    tt2

  • Delete adjacent duplicates how to use in the below select statement

    hi i have a problem
    i am suing the below select statement
    SELECT    a~extno
              a~guid_lclic       " for next select
              e~ctsim
              e~ctsex
    *revised spec 3rd
              f~guid_pobj
              f~amnt_flt
              f~amcur
              f~guid_mobj
              e~srvll     "pk
              e~ctsty     "PK
              e~lgreg  "PK
      INTO TABLE gt_sagmeld
      FROM /SAPSLL/LCLIC  as a
      INNER JOIN /sapsll/tlegsv as e on elgreg = algreg
      inner join /sapsll/legcon as f on fguid_lclic = aguid_lclic   " for ccngn1 selection
      inner join /sapsll/corcts as g on gguid_pobj = fguid_pobj
                               where   a~extno in s_extno.
      sort gt_sagmeld by guid_lclic lgreg ctsty srvll GUID_POBJ GUID_MOBJ.
      delete adjacent duplicates from gt_sagmeld comparing guid_lclic lgreg ctsty srvll GUID_POBJ GUID_MOBJ .
    now i am confused how to use delete adjacent dupliacate and on which fields
    as first table /sal../lclic primary key is guid_lclic
    and it is joined to table
    legcon by guid_lclci ( not a primary key here)
    legcon primary key is guid_legcon
    and table 3 legsv by lgreg (pk here)
    table 3 has tow more primary key srvll and ctsty also
    NOW MY QUESTIO IS TAHT IS I USE ABOVE DELETE ADJACENT STATMENT IT FETCHES 20 LAKH RECORDS
    I WANT TO REDUCE IS LET ME KNOW ON WHAT fields i need to use delete adjacen duplicates
    or use comparing all fields?
    regards
    Arora

    hi sudha
    if u see my select statement is contains four Primary keys
    srvll
    lgreg
    ctsty
    guid_lclic
    but the next table connected to this table legcon is by guid_pobj and anothe table by guid_mobj
    and if i take this gt_sagmeld to another temp table and i find abt 10 lakh uniques guid_pobj
    similary 6 lakh guid_mobj so the next slect is hanpering because of this
    not COMING TO OUR POINT IF I SORT ONLY BY OUR PRIMARY KEYS NOT TAKING INTO ACCOUNT TEH GUID_POBJ AND GUID_MOBJ
    THE ENTRIES ARE VERY LESS BUT IF I TAKE INOT ACCCOUNT IN GT_SAGMELD THE ENTRIES ARE ABT 20 LAKH
    SO I AM NOT SURE WHETHER TO TAKNE GUID_POBJ AND GUID_MOBJ INOT ACCOUNT FOR DELECTING ADJACENT DUPLICATES?
    HENCE THE QUESTION OF ON WHICH FIRLD DELETE OR COMPARING ALL FIELDS I USE?

  • Each song on my iTunes has a duplicate. How do I delete all duplicates and prevent this from happening again in the future?

    Each song on my iTunes has a duplicate. How do I delete all duplicates and prevent this from happening again in the future?

    After I had updated to Itunes 11 (also on Windows 7), I had the same experience, but I suspect that it was because I accepted a proposal to set up an external media library in order to simplify security backups. An associated result was that I had lost all of my playlists!
    What I did was to restore the entire library off my Ipod, using a very good program called PodToPC (a free download is available) selecting an option to replace all of the stuff in the Itunes library. I use the Ipod Classic simply because it has a large capacity to hold my collection of CD and Vinyls. No way was I going to modify duplicates of 10000 tracks in 750 playslists by hand!  I did have a few residual problems with some of the playlist specs but, after a few hours of work all was restored.
    I hope this is useful.

  • How do I delete exact duplicates in my library?

    How do I delete exact duplicates from my library?

    @Blouwagie:
    You should always make a bootable backup BEFORE you do major updates.
    If things go wrong you can always revert to what you had previously.
    You can do this with Carbon Copy Cloner or Super Duper. (I use CCC for a long time, and I'm very satisfied about it, I can recommend it)
    It used to be donation ware, but now you need to pay a small fee. Not a big price for always knowing you're safely backed up.
    If you don't have a bootable clone from before the update, and would like to revert to 10.7, check this:
    https://discussions.apple.com/thread/4560565
    seems to work.
    didn't need it myself since I waited to update, I always check this forums first to find out what are the issues/bugs.  When there seems to be none or little problems, I update. I've learned my lesson long time ago. Patience is a good thing...
    So, always backup. More important than your changing underwear daily. Time machine isn't enough. Make two bootable clones. One at your place and one at a different location (theft, fire, ...), you can always revert from there.
    +Send Apple your feedback.
    http://www.apple.com/feedback/itunesapp.html

  • TS3569 On my iPad 2, one particular recurring event keeps duplicating itself. I delete the duplicate and it reappears a day later. Help.

    On my iPad 2, one particular recurring event keeps duplicating itself. I delete the duplicate and it reappears a day later. Help.

    Do you use MobileMe and an iPhone? If yes, do this in the following order:
    Mac:
    (1) back up the applications giving you problems
    iPhone
    (1) Open settings, then open "mail, contacts, calendars"
    (2) Open .Mac account
    (3) Turn OFF the applications that are causing problems
    (4) When you turn off on of the applicatios, a red sign "stop syncing" will appear. Press it. A msg will appear "turning off xxx"
    (5) Get out of settings
    (6) Don't do anything for about 20 mins. Don't touch your iPhone or your Mac. (syncing needs time to settle down)
    After 20 minutes...
    Mac:
    (1) Open each application that is giving you problems. Fix errors. Back up.
    (2) Do this for each application
    iPhone
    (1) Open settings, then open "mail, contacts, calendars"
    (2) Open .Mac account
    (3) Slide switch to ON for each app you turned off; there won't be a msg
    (4) Get out of settings
    (5) Via MobileMe, syncing will start again.
    Wait about 20 minutes, again. You should see all in order after that. At least, that was my experience.

  • Probelm with DELETE ADJACENT DUPLICATES

    Hi Guys!
    Here's the scenario, I have this syntax in my report..
    delete adjacent duplicates from it_itab comparing matkl sptag+0(6)
    The values inside the it_tab is as follows..
    20080301|01010402
    20080301|02024301
    20080305|01010402
    20080310|01010402
    when I debug it, and used the syntax delete adjacent duplicates from it_itab comparing matkl sptag+0(6),
    the output will be like this....
    20080301|01010402
    20080301|02024301
    20080305|01010402
    I dont know why this output showed up. I'm expecting do have this output
    20080301|01010402
    20080301|02024301
    Could someone explain why this happened? Is there a problem or loop hole in delete adjacent duplicate?
    Please help! thanks so much!
    Regards,
    Mackoy

    hi
    do this:
    sort it_itab by matkl sptag.
    delete adjacent....
    delete adjacent will always look for the adjacent entries, and if a dupliacte is found then it deletes the 2nd records.
    for ex , u have,
    var1
    123
    123
    124
    125
    123
    in this case....2nd record is deleted and the output will be
    123
    124
    125
    123 . if it was sorted by var1 and then delete adjacent duplicates was used then it will have unique records.
    regards,
    madhumitha

  • After restoring my 3Gs I now have duplicate--sometimes triplicate calendar entries. How can I delete the duplicates from the phone?

    On the info tab I'm told that my calendar is being synced through MobileMe and directly with the computer resulting in duplicated data. How do I prevent that? And how do I now delete the duplicates from the phone?
    I notice that the entries from the computer show "Busy" in the status while the others--probably from MobileMe-- do not.
    Ron

    Solved the problem...I think. In the Calendar app I clicked on the Calendars button. There I found, under Show All Calendars "From My Mac." There I found not only the calendars as they appear in iCal and MobileMe, but the same items with brackets containing my MobileMe address plus other info that isn't visible enough to see what it is (looks like "@calendar).
    Ron

  • HT2905 Is anyone having iTunes crash whenever they try to delete a (duplicate) song or playlist? If so, any workarounds?

    Ever since I upgraded to Lion 10.7.4, I've been having a headache-of-a-time with applications unexpectedly quitting (especially Apple apps like Pages & Numbers and iTunes). Every time i try to delete a (duplicate) song (by any method, whether it's control-click, edit menu-delete, or command-delete, etc.) I get the spinning beach ball and then an expectedly quit "do you want to re-open?" window. Can anyone offer detailed advice how to downgrade iTunes to a pre-10.6 version? (where to find and download/install?), or is the problem probably OS-related, and I just have to wait it out until 10.8 becomes available?

    Yes, the list on my computer of what is in my iPod library is grey, not black font. I tried "manual" but it will not allow me to drag anything to the iPod. Not even newly purchased music.
    That certainly sounds like one of the Automatic syncing options has been engaged.
    ... quickly doublechecking, just in case. After selecting "Manually manage ..." in the device tab for the iPod in iTunes, did you click "Apply"?

  • HT4915 When i did my itunes match, there were some duplicated albums and songs.  I have gone into my library and deleted the duplicates, but they still show up on my iphone as duplicates.  What can i do to get rid of them?

    When I did my itunes match, there were some duplicated albums and songs in my library.  I have gone back into my library from my computer, and deleted the duplicates.  When I did so, itunes did not ask me if I wanted to delete them from the cloud.  They are still showing up on my iphone as duplicates in the cloud.  What can I do to get them from showing up in my iphone?

    They are not on the iphone in the first place.  It is just a setting that allows you to see the songs that are available in icloud, but not on your iphone.  If you turn the setting to off, then you no longer see the songs that are in icloud, but NOT on your iphone.

  • How to delete the duplicate email address in BP master data

    Hi,
    When  you get an email ids from the third party vendor and you are loading into CRM BP master data.  how to delete the duplicate email address already exits in the system.  In CRM you can create the same BP with different id.   I would like to know how to delete the email address during importing email addresses from the third party tool.
    During the campaign you are sending email to all your customers, when the customer want to unsubscibe the email address from your list, how to unsubcribe the email address and how to updat the BP master data. 
    If you are sending the email to customer, you are using html or simple text, if the customer wants only html or simple text, how you to specify in the system?
    thanks,
    arul

    Hello Arul,
    welcome to the SDN CRM Development forum.
    1. I think you should clear the data with duplicate E-Mail adresses in the external tool.
    2. Unsubscription could be done by a Marketing Attribute which could be set by using a Target Group which is created by Campaign Automation. Have a look at this Toppic. There is also a Best Practice avaliable at http://help.sap.com/bp_crmv340/CRM_DE/index.htm.
    3. Also HTML or Simple text can be mained in a Marketing Attribute. You have to use different Mail Forms to which are sent to different Target groups.
    Regards
    Gregor

  • I just upgraded to the latest version of iTunes and it duplicated virtually every track in my music library. I need a quick way to delete the duplicates. Sorting by "Date Added" will not help because they are all listed as added on 12/12/2011.

    Library Duplicated
    I just updated to the latest version of iTunes and it duplicated virtually every track in my library. I need a quick way to delete the duplicates. Sorting by "Date Added" will not work, because every track is listed as added on 12/12/2011 even though this happened today 12/19/2011.

    I've written a script called DeDuper which can help remove unwanted duplicates. See this  thread for background.
    tt2

  • How do I delete multiple duplicates of songs in my playlist without doing one at a time.  Windows 7 on HP.  Lexmac

    How do I delete multiple duplicate songs from my playlist without doing one at a time?
    <Edited by Host>

    I've written a script called DeDuper which can help remove unwanted duplicates. See this  thread for background.
    tt2

Maybe you are looking for

  • Skipping Pages in a PWB Smartform

    Hi All,      I have created one application form and a related smart form. The name of the Application Form is IS_U_CA_INSTPLAN. This, when run in mass run,  is executed for a few number of times based on certain conditions. My associted smart form i

  • HT201401 I tried to do a suggested update to my 3 and it killed the phone, says it cannot restore it either. What is next?

    How can I restore my 3G I Phone. I tried an I Tunes update from my computer and it wiped my phone. All I get is a picture of a cord attaching to I Tunes and the message on my computer saying unknown error, cannot restore. Really, let's get real here-

  • What's up with Bridge color management?

    After getting a wide gamut monitor (Eizo S2243W) it was a delight to be able to see the Adobe RGB colors that I knew were in the file, but previously couldn't be displayed. Although the Windows desktop and UI elements look garish, I sort of got used

  • After Effects and Premiere dont start on a new Mac.

    Heyho community, one thing up front... my english is not the best, so please be patient if i dont understand everything straightaway. my macbook is just a few weeks old, means i am a noob to mac osx. i recently installed the adobe creative suite and

  • MBP AC Adapter Shuts Down my 24v to 220v Inverter

    Hello, Here is a question that is both Apple MBP and electrical related.  I hope to find someone with some expertise in both these subjects. I have a Macbook Pro 17", a 60w ac adapter, and I'm powering my device while on a 220v power, powered by a 60