on 08-07-2009 10:59 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you need to fill the record number yourself in the routine otherwise the technical key of all the records you generate from the same source record will have the same key and therefor your load will dump on not uniqueness of key
add a counter and fill the field RECORD:
v_count = v_count + 1.
RESULT_FIELDS-record = v_count.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.