Skip to Content
author's profile photo Former Member
Former Member

DTP Error: Duplicate data record detected

Hi experts,

I have a problem with loading data from DataSource to standart DSO.

In DS there are master data attr. which have a key containing id_field.

In End routine I make some operations which multiple lines in result package and fill new date field - defined in DSO ( and also in result_package definition )

I.E.

Result_package before End routine:

__ Id_field ____ attra1 ____ attr_b ...___ attr_x ____ date_field

____1________ a1______ b1_________ x1

____2________ a2______ b2_________ x2

Result_package after End routine:

__ Id_field ____ attra1 ____ attr_b ..___ attr_x ____ date_field

____1________ a1______ b1_________ x1______d1

____2________ a1______ b1_________ x1______d2

____3________ a2______ b2_________ x2______d1

____4________ a2______ b2_________ x2______d2

The date_field (date type) is in a key fields in DSO

When I execute DTP I have an error in section Update to DataStore Object: "Duplicate data record detected "

"During loading, there was a key violation. You tried to save more than one data record with the same semantic key."

As I know the result_package key contains all fields except fields type i, p, f.

In simulate mode (debuging) everything is correct and the status is green.

In DSO I have uncheched checkbox "Unique Data Records"

Any ideas?

Thanks in advance.

MG

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2009 at 12:42 PM

    Hi Maciej,

    Every time when you create new record increase a record number. In Result_package this is your key.

    Hope it helps.

    Regards,

    DL

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2009 at 10:11 AM

    You need to check your end routine, it must be thorwing duplicate key. Is there a possibilty of date being blank and same key being passed in...just guessing.

    Vikash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 07, 2009 at 10:16 AM

    Hi,

    In the end routine you have a field called record which must be unique...

    It is the record number...

    SInce you are appending new records it seems this field is duplicated... While filling the result_package you will have to assign record number in this field like 1,2 ,3 and so on...

    Then it should work...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2009 at 10:50 AM

    Hi,

    Please check Error DTP. it can show you which records are duplicate. read detail msg in error DTP. If possible delete error DTP data or correct and upload into DSO and then proceed with next upload.

    Regards

    Sangita

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2009 at 11:09 AM

    Hi,

    In the end routine, try giving

    DELETE ADJACENT DUPLICATES FROM RESULT_PACKAGE COMPARING XXX YYY.

    Here XXX and YYY are keys so that you can eliminate the extra duplicate record.

    Or you can even try giving

    SORT itab_XXX BY field1 field2 field3 ASCENDING.

    DELETE ADJACENT DUPLICATES FROM itab_XXX COMPARING field1 field2 field3.

    this can be given before you loop your internal table (in case you are using internal table and loops) itab_xxx is the internal table.

    field1, field2 and field 3 may vary depending on your requirement.

    By using the above lines, you can get rid of duplicates coming through the end routine.

    Regards

    Sunil

    Edited by: Sunny84 on Aug 7, 2009 1:13 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2009 at 12:48 PM

    Thanks Mansi and Dariusz.

    I made counter in loop and I fill a field result_package-record with that counter.

    It solved problem.

    Best regards.

    MG

    Edited by: Maciej Garecki on Aug 7, 2009 2:49 PM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.