Identfying the Duplicate Entries

Hi All,
As per my requirement
1.  The internal table is the input.
2.  I need the duplicate records of the internal table with the combination of 2 key fields.
3. I should not use SORT because i need the  index number in order as per in the table .
EX :           Take Table MSEG.
                  Take key fields as MBLNR and WERKS.
                  I want the duplicate records of the combination of these 2 key fields.
                  The *Index Number * should not to be changed as per the table entry.  ( So i avoided sorting the internal table)
Kindly give some solutions.
Thanks,
Pradeep.
Moderator message : Requirements dumping not allowed, show the work you have already done.  Thread locked.
Edited by: Vinod Kumar on Mar 1, 2012 4:19 PM

Use DELETE ADJACENT DUPLICATES COMPARING MBLNR AND WERKS
For this we need a sorted table on MBLNR and WERKS...
Why not sort the table on MBLNR and WERKS, do the DELETE and sort the table back to the index field?
Kr,
Manu.
Edited by: Manu D'Haeyer on Mar 1, 2012 11:49 AM

Similar Messages

  • Abap Code to Delete the Duplicate Entries in Datasource

    hI Friends I have a code that I am writing to delete the duplicate entries from CRM Custom Datasource  but it is throwing me error that INVERNO The specified type has no structure and therefore no component called INVERNO Should i define the structure please correct my code below so that it will work to delete the duplicate entries          
    Please help
    Data: l_s_ZOXD530051 like ZOXD530051. ***Extract Structure of Data source
    Case i_DATASOURCE.
    when 'ZZ_DS_CUSTOM_CRM_VALUES'.
    Sort C_T_DATA by INVERNO ZMKT_TYP.
    *write this Statement.
    DELETE ADJACENT DUPLICATES FROM C_T_DATA COMPARING INVERNO ZMKT_TYP.
    endcase.
    Thanks
    Soniya
    null

    Hi
    It means there's no field called INVERNO:
    Data: l_s_ZOXD530051 like ZOXD530051. ***Extract Structure of Data source
    Case i_DATASOURCE.
    when 'ZZ_DS_CUSTOM_CRM_VALUES'.
    <b>*Sort C_T_DATA by INVERNO ZMKT_TYP. <------</b>
    Sort C_T_DATA by INTRENO ZINS_TYP.
    *write this Statement.
    DELETE ADJACENT DUPLICATES FROM C_T_DATA COMPARING INTRENO ZINS_TYP.
    endcase.
    Max

  • How can I get rid of the duplicate entries in icalendar?

    How can I get rid of the duplicate entries in icalendar?

    Please take a look here http://webaim.org/blog/plague-of-outline-0/
    If, after reading the above, you still want the outline removed the add the following style rule to your document.
    ul.MenuBarHorizontal a {
        outline: none;

  • Counting the duplicate entries without looping itab.

    Hi ,
    I want to count the duplicate entries in  itab without looping
    the itab.
    can any one help me....

    If you just want to know the number of duplicate entries:
    DATA:
      zlt_itab1 TYPE ....
      zlt_itab2 LIKE itab1,
      zlv_lines TYPE i,
    *-Copy table
    zlt_itab2 = zlt_itab1
    *-Sort on field to count duplicates:
    SORT zlt_itab2 BY <field for counting duplicates>
    *-Total number of lines:
    zlv_lines = LINES( zlt_itab2).
    *-Remove duplicates:
    DELETE ADJACENT DUPLICATES FROM zlt_itab2.
    *-Calculate number of duplicates:
    zlv_lines = zlv_lines - LINES(zlt_itab1).
    Regards,
    John.

  • To eliminate the duplicate entries while looping into final internal table

    Hi friends,
    IAam facing the follwoing problem.
    Get Shipment for the Delivery number
          SELECT tknum
                 vbeln
                 INTO TABLE lt_vttp
                 FROM vttp
                 FOR ALL ENTRIES IN lt_vbfa
                 WHERE vbeln = lt_vbfa-vbelv.
        IF sy-subrc EQ 0.
          SELECT vbeln kunnr
                 FROM likp
                 INTO TABLE lt_likp
                 FOR ALL ENTRIES IN lt_vttp
                 WHERE vbeln = lt_vttp-vbeln.
      endif.
    now iam my internal table lt_vttp i have following values
       shipment             delivery
          1000                  2000
          1000                 2001
    in my internal table lt_likp i have the follwoing values
          delivery              shipto
           2000                  ABC
           2001                  ABC
    now iam looping those values in a final internal table.
      LOOP AT lt_likp INTO ls_likp.
        CHECK sy-subrc EQ 0.
         READ TABLE lt_vttp INTO ls_vttp WITH KEY vbeln = ls_likp-vbeln BINARY SEARCH.
        CHECK sy-subrc EQ 0.
             SELECT SINGLE * FROM vttk INTO ls_vttk
                    WHERE tknum = ls_vttp-tknum.
                  CHECK sy-subrc EQ 0.
                APPEND ls_vttk TO lt_vttk.
       endloop.
    Now my problem is if the shipment is same and the shipto is same then need to eliminate the duplicate records.
            in internal table iam getting 2records with same shipment and shipto combination.
           but instead if both the shipment and shipto are same then i should elimate the duplicate entries.
    and for the same shipment if i have differnt shipto then i neeed those 2 value.
    can any body tell me how can i get that.
    Regards
    Priyanka.

    Hi Priyanka,
    In your code you are using seelct statement inside the loop which will affect the performance.
    So, declare a another internal table which contains your both shipment and shipto elements with other required fields, say the name is lt_new.
    sort lt_new by shipment shipto.
    delete adjacent duplicates from lt_new comparing shipment shipto.
    "then use for all entries to choose values from VTTK.
    Hope this helps you.
    Regards,
    Manoj Kumar P

  • How to find the duplicate entries in column

    clolum name descripitoin ex:
    CLIENT_NAME | Last Name | First Name | Middle Name |suffix | Tendulkar Sachin Ramesh Jr.Sachin
    | | Sachin Tendulkar Ramesh Jr.Sachin
    | | Ramesh Sachin Tendulkar Jr.Sachin
    PANno | no | AUBIU1966E
    Address | Address of clint | Any address
    Insert multiple records as per the e.g. shown in table. Write a oracle procedure in database schema to input the string and identify the possible duplicates from above table.

    942919 wrote:
    HI
    but clint name is like
    CLINT_NAME
    Sachin Tendulkar Ramesh
    Sachin Ramesh Tendulkar
    Tendulkar Sachin Ramesh
    in this senario clint name column show diffrent names
    your query is not working
    above three entries are same we need to find aboue three entries are duplicate1. Have one other column called Name2 in the table
    2. scan the table and run the "combined" (means you combined every row from below separated by a space) the below output into name2 column
    with t as (
         select 'Sachin Tendulkar Ramesh' col from dual
         select TRIM(substr (splitted,
              instr (splitted, ' ', 1, level ) + 1,
              instr (splitted, ' ', 1, level+1) - instr (splitted, ' ', 1, level) -1 )) as ret_row
         from (select ' '||col||' ' splitted
         from t)
         connect by level <= length(splitted)-length(replace(splitted,' ',''))+1
         and instr (splitted, ' ', 1, level+1) - instr (splitted, ' ', 1, level) -1 > 0 order by 1;
    3. now run this
    select name2,count(*)
    the same like above but group by name2, then you will see it

  • Duplicate entry is not deleted from the TCA tables

    Hi
    We are using Oracle Customer Online to find the duplicate data and Oracle Data Librarian to remove the duplicacy. The request to remove the duplicates is taken up by ODL and the task is performed. When checked from OCO it shows that the duplicate entry has been erased but when checked in the TCA table HZ_PARITES, the entry is still there. Can anyone please help regarding this as why this is so... after removing the duplicate entry why is it still there in the table or if the entry is still there then why cant you access it through OCO
    Regards
    Sourav Biswas

    Hi,
    Did you check the value for "STATUS" column in HZ_PARTIES table for the deleted records? It must be "D" which reperesents "Deleted". See the "REGISTRY_STATUS" AR lookup which validates the Party Statuses.
    When duplicates are eliminated using Data Librarian/Party Merge, the records are not actually deleted from the database, instead the party status will be changed to "D". This must be the reason for not being able to see the records from Customers Online.
    I guess, the same case might have occurred to your entries.
    Wishes,
    RK Goud

  • Every time I sync my iCal computer with my iPhone 4 or iPad, duplicate entries are generated on both systems. What am I doing wrong or how can I avoid the duplications?

    Every time I sync my iCal on my computer through iTunes with my iPhone 4 or iPad, duplicate entries are generated on both systems. What am I doing wrong or how can I avoid the duplications? I have been doing this for several years and this problem is a more recent issue, like in the last 6 months. I have been deleting the duplicate entries, on both systems, but some duplicates reappear through "general" entries that are connected to the correct color for a Calendar, but not the name. I am going nuts and wasting tons of hours trying to get the 3 calendars to sync without generating duplicate entries.

    Choose one of the Calenders on ONE of the computers OR the MobileMe as the Master / correct account.
    The REINITAILISE the data of MobileMe within preferences on the computer defining the datatransfer correctly (in the advanced box of preferences). The synchronise iphone contacts and calender directly on-line to MobileMe.
    I posted a question on this today, and gave my own reply !
    Regards,
    Kevin

  • How to restrict the duplicate values in lov column of VO based Adv Table

    Hi Gurus,
    I want to restrict the duplicate values at lov which is a colunm in an Adv Table.
    If user enters duplicate values then first it should show an error msg that Duplicate values have been entered.
    After the duplicate values have been removed, then the user can save all the values in the table.
    My Adv Table is based on a VO.
    The link how to restrict the duplicate values at form level
    talks about Adv Table based on a EoVO, which doesnot work in my case.
    My Approach,
    I am iterating through RowSetIterator and committing through PROCEDURE.
    I am able to avoid duplicate entry through a function checkRespId. (given below)
    Below code is for iterating and committing.
    public void saveline(String reqid,String userid)
    System.out.println("RequestId/saveline"+reqid);
    System.out.println("UserId/saveline"+userid);
    OAViewObject vo = (OAViewObject)getRespLineVO1();
    RespLineVORowImpl row = null;
    int fetchedRowCount = vo.getFetchedRowCount();
    RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
    if (fetchedRowCount > 0)
    deleteIter.setRangeStart(0);
    deleteIter.setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    System.out.println("Inside the for LOOP");
    row = (RespLineVORowImpl)deleteIter.getRowAtRangeIndex(i);
    String respoidid = row.getAttribute("ResponsibilityId")+"";
    String respname = row.getAttribute("ResponsibilityName")+"";
    String stdate = row.getAttribute("StartDate")+"";
    String enddate = row.getAttribute("EndDate")+"";
    String linestatus ="A";
    if(userid!=null)
    if(!(respoidid.equals("null")) && respoidid!=null)
    String checkingrespid=null;
    checkingrespid = checkRespId(userid,respoidid);+contains no if not duplicate and yes if its duplicate+
    System.out.println("checkingrespid for Resp with ID :"+respoidid+"exists or not "+checkingrespid);
    if(checkingrespid.equals("No"))
         String message, result = null;
    Connection txn = getOADBTransaction().getJdbcConnection();
    try
    calling PROC ...
    catch(Exception e)
    message = "Error in Inserting into line" + e;
    throw new OAException(message, OAException.ERROR);
    else
    throw new OAException("You have entered duplicate no. of values", OAException.ERROR);
    else
    System.out.println("respoidid is null");
    break;
    deleteIter.closeRowSetIterator();
    public String checkRespId(String userid,String respoidid)
    String createRow="No";
    OAViewObject vo = (OAViewObject)findViewObject("CheckRespVO1");
    if (vo != null)
    vo.setWhereClauseParams(null);
    vo.setWhereClauseParam(0, userid);
    vo.setWhereClauseParam(1, respoidid);
    vo.executeQuery();
    System.out.println("ROW COUNT IS "+vo.getRowCount());
    if(vo.getRowCount()>0)
    createRow="Yes";
    else
    createRow="No";
    return createRow;
    Problem:
    I remove the duplicate entries and click on save and get this error.
    Unable to perform transaction on the record. \nCause: The record contains stale data. The record has been modified by another user.
    \nAction: Cancel the transaction and re-query the record to get the new data.
    Thanks,
    Sombit

    Hi Anil,
    I am trying out your code but stuck in inserting the rows
    using your code in URL: http://oracleanil.blogspot.com/2010/09/oaf-passing-table-type-object-to-oracle.html
    I am always getting the same exception i.e COde blast in when I run.
    My modified code is:
    String[] as = null;
    Number[] vNumber = null;
    Number[] vNumberrespid = null;
    Number reqidnumber = null;
    reqidnumber = new Number(Integer.parseInt(reqid));
    Connection txn = getOADBTransaction().getJdbcConnection();
    String mCreateSearchRequestStatement = null;
    OAViewObject vo = (OAViewObject)findViewObject("RespLineVO1");
    int j = vo.getFetchedRowCount();
    try
    System.out.println("abouce try");
    vo.reset();
    if (vo.getFetchedRowCount() > 0)
    System.out.println(String.valueOf("Fetched row count ").concat(String.valueOf(vo.getFetchedRowCount())));
    int i = 0;
    as = new String[j];
    vNumber = new Number[j];
    vNumberrespid = new Number[j];
    while (vo.hasNext())
    vo.next();
    System.out.println(String.valueOf("Inisde the do while loop").concat(String.valueOf(i)));
    vNumber[i] = (reqidnumber);
    vNumberrespid = ((Number)vo.getCurrentRow().getAttribute("ResponsibilityId"));
    as[i] = String.valueOf(vo.getCurrentRow().getAttribute("ResponsibilityName")).concat(String.valueOf(""));
    System.out.println("Request ID "+reqidnumber[i]);//getting null even there is some value selected
    System.out.println("ResponsibilityId "+vNumberrespid[i]);//getting null even there is some value selected
    System.out.println("Resp Name "+as[i] );//getting null even there is some value selected
    i++;
    CallableStatement cs = txn.prepareCall("{call XX_PassTableType.XX_PassTableType_prc(:1, :2,:3)}");
    ARRAY array = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumber);
    ARRAY arraynew = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumberrespid);
    ARRAY array1 = new ARRAY(new ArrayDescriptor("APPS.JTF_VARCHAR2_TABLE_100", txn), txn, as);
    cs.setArray(1, array);
    cs.setArray(2, arraynew);
    cs.setArray(3, array1);
    cs.registerOutParameter(3, 2003, "JTF_VARCHAR2_TABLE_100");
    cs.execute();
    ARRAY error = null;
    error = (ARRAY)cs.getArray(2);
    if ((error != null) && (error.length() > 0))
    System.out.println(String.valueOf("Error is ").concat(String.valueOf(error.getArray())));
    String[] retError = new String[j];
    retError = (String[])error.getArray();
    System.out.println(String.valueOf("Error in saving data").concat(String.valueOf(retError[0])));
    cs.close();
    catch (Exception exception)
    throw new OAException("code blast", OAException.ERROR);
    Thanks,
    Sombit

  • Stop duplicate entry of item in Order management sales order

    Dear,
    i have a requirment to stop duplicate entry (while making sales order) in Order management Sales order. When user enter any new line on the sales order then it is validate that same item has already been selected before in the same order.
    If user hase already select that entry then form shows error and restrict the duplicate entry.
    i have to achive this funcionality on the standard Sales Order form of Order Management Super User.
    Regards,

    Please review these docs and see if it helps.
    [ID 1105868.1]
    ARCHIVED: Cannot Change Selling Price On Sales Order Lines [ID 414472.1]
    Transaction Workbench Error: FRM-40735 ON-UPDATE Trigger Raised Unhandled Exception [ID 781264.1]
    Thanks,
    Hussein

  • Deleting Duplicate Entries in sender JDBC adapter

    Hi i am working on JDBC to IDOC scenario.
    When i am fetching the records from the Oracle database table using select query, i am getting the records but its getting duplicated many a times and hence its failing at an idoc processing at ECC side..
    Could someone help me in deleting the Duplicate entries and passing only the required entries from Oracle databse to IDOC.
    Here is my select query.:
    Select a.order_num, a.sap_delivery_number, a.sap_delivery_line_number, a.warehouse, a.product, a.product_size, a.order_qty, a.ship_qty from XXX_h a,tr_log t where a.Prod_id = 101..
    Appreciate your help.
    Regards

    >> Its not picking up the old data instead, it is repeating the same set of data multiple times.
    The below suggestion might be helpful
    a) First do your select statement
    b) Second , Use update statement and here set some flag in that table that these records are already queried.  say boolean read = true for the above queried records.
    That's it. When you query next time, you will not reread the same data. You will read the new data.
    Duplicate Entries:  Check with db client tool like Toad or sqlplus and see whether duplicate entries exists in the table. If so, then fix the data first.
    Edited by: Baskar Gopal on Feb 22, 2011 1:02 PM

  • Duplicate entry in AS2 EDIINT MIC table

    Hi,
    While sending a AS2 message to a partner, got an error saying  -
    Unable to create the entry in the AS2 EDIINT MIC table. This could be caused by duplicate AS2-From, AS2-To and MessageID combinations being written to the table.
    MSDN says that I need to delete the duplicate entry. As this happened in Test environment, I did the same and everything fine.
    But, in Production, I don't want to delete anything.
    So, can somebody help me on understanding the importance of MIC table i.e how it works and when/how duplicate transactions can happen in this table?
    Thanks and Regards,
    Sugata

    Hi,
    As the error message reads the problem is due to a deadlock situation.
    http://stackoverflow.com/questions/5389261/sql-transaction-was-deadlocked
    http://www.toadworld.com/platforms/sql-server/b/weblog/archive/2012/05/16/transaction-process-id-was-deadlocked-on-resources-with-another-process-and-has-been-chosen-as-the-deadlock-victim-rerun-the-transaction.aspx
    Check with the above articles in which deadlock can be identifed and removed.
    Regards, Vivin.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Duplicate entries getting posted using FB01

    Hi All,
    I am facing a very strange problem which I have never heard of before.
    There is a report program which picks up an input file from the application server and posts the entries. This input file will contain all the details about header record, vendor line items and G/L line items.
    The report checks for duplicate entries comparing the reference number and the vendor. It discards the duplicate entries. It does not post duplicate entries.
    Now, the input file contains the reference number only once. It also has multiple line items for that refernce. But has posted two identical documents having same reference, company code, etc. The only thing that is different is the document number and the time of entry. There is just a few seconds gap between the posting of the two entries.
    Ideally FB01 should also not allow to post such identical entries.
    Please suggest possible reasons for such postings.
    Thanks & Regards,
    Namrata

    Hi,
    Manually everything is working fine. Also through this report everything works fine always except for this case which happened.
    The input file had a lot of references for posting. But just one got duplicated. So, I was just wondering what could have gone wrong.
    Could it be because of some database commit or due to some memory buffer refresh which did not happen by mistake.
    I'm just trying to figure out some possible causes for such a thing.
    Your inputs and thoughts are welcome.
    Thanks & Regards,
    Namrata

  • Duplicate Entries in Library

    In the process of trying to move my itunes library to an external drive, I've ended up with duplicate entries for each file. Both entries play the same file, but when one entry is deleted from the library, the file gets deleted, and the remaining entry does not play. How do I remove one of the duplicate entries without deleting the file?

    It seems there's only one library - on the external drive. Before I moved my library, I looked in itunes help to figure out how to do it properly, and never really got a clear answer, so I just copied and pasted my files onto the external drive, then deleted the original library off the internal drive, and things went from bad to worse from there. Everytime I consolidate the library, it just seems to duplicate everything, not really solving the problem. It's not a question of duplicate files - it's more a question of duplicate listings/entries for the same single file so that if I delete the wrong entry/listing from the library, the remaining listing can't find the file to play, because I've just unwittingly deleted the music file.

  • Right Click Move menu has duplicate entries

    One of my users frequently sorts mail into subfolders on a shared mailbox. They most commonly do this by right clicking the message, selecting Move, then selecting the folder. 
    Somehow, they ended up with a duplicate entry in the right click menu. In other words, the folder "October 2014" appears twice in the list.
    The first question is: how can the duplicate entry be removed?
    Secondly, one of these menu items works. When it is selected, the message can then be found in the "October 2014" as expected. The other of these menu items does not work. When it is selected, the mail is no longer in it's original location (inbox,
    etc.) but  also does not appear in the "October 2014" folder. Searching her mailbox (even searching all of Outlook) returns no results when searching for a message moved this way. I've
    also used Get-mailboxfolderstatistics to examine the folder structure of both her account and the shared mailbox account. Only the one folder named "October 2014" appears to exist.
    Second question: How can I find where messages moved with the duplicate entry were moved to? How can I move them to the correct folder?

    Hi,
    Do you mean there is a duplicate entry in the Move To Folder history that you see when selecting
    Move?
    We can try to clear the Move To Folder history to check the result. To do this, please follow:
    1. Exit Outlook.
    2. Open your Registry Editor and navigate to:
    Outlook 2013
    HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles\profile name\0a0d020000000000c000000000000046
    Outlook 2010 or previous on Windows NT, 2000, XP, Vista, Windows 7 or Windows 8
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\profile name\0a0d020000000000c000000000000046      
    3. Find the registry value named 101f031e.
    4. Rename or delete the value and restart Outlook.
    Now, the Move To Folder history will be cleared and next time you move a email to a folder, Outlook will add the entry to the history again.
    For the second question, how did the user add the shared mailbox in his Outlook? Please note that in some configurations, you are limited to using the
    Current Folder search scope when searching in a shared mailbox. Please try to directly login to the shared mailbox and then search for the disappeared emails. Please let me know the result.
    Hope this helps.
    Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

Maybe you are looking for

  • Downgrading a AIR-LAP1131AG-A-K9

    Hi, How can i downgrade my 1131AG Light weight access point to autonomous mode(which IOS should i use?). Any documentation or comments will be helpful. Thanks in advance Regards Sri

  • About Change in Printing form of purchase order

    Hello friends, How to attach user defined SAP SCRIPT of SMART FORM to purchase order?

  • Why is the iPad 2 not recognizing my video from my camera?

    have an iPad 2, camera connection kit, Canon T3i. I am trying to transfer video to the iPad 2 via the connection kit and an SDHC from SanDisk, why does it not play? It xfer's the pictures and they show up but all the video file says is MOV in grey?

  • How do I rid my Iphone of duplicate contacts

    I synced my Iphone with Outlook. Previously I was syncing with my Yahoo.com account. Now I have many duplicates and there is no way I can find to delete them from the Iphone. Is there any way to manage the Iphone contacts from ITunes? How do I fix al

  • Unit of measures for Swiss Export

    Hello there, were currently working on the implemntation of swiss export. Now were facing an issue with the external UOM´s the swiss authorities is requesting. We have to report f.e. 17     Stück (Tiere)      / Piece/Head (Animals) 18     Stück (Uhre