How to resolve “DB: : unique constraint violated” error in CPI DS
I have explained what leads to “DB: : unique constraint violated” error in CPI DS and how to resolve this in this blog. Hope you guys find it useful.
In my project we had a scenario where the requirement was to update same KeyFigure Table through three data flows under the same Task. We were picking the data from one single Ztable on Source side that is S4 Hana and sending it to IBP through 3 different data flows under the same Task.
But when you try to update the same KeyFigure table with more than one data flows it often gives the error of “Unique constraint violated”. Even if you map “ID” field (which is a Key field in the table) with gen.uuid() it will give the same error.
1.Open the task and go to ‘Execution Properties’.
2. Under Execution Properties section you will find ‘Begin post-processing’ tab. Under that select ‘after each data flow’ and also tick the check box of ‘Treat processed with Error as success’.
Please refer to the below screenshot.
Now try to run the same task again and now it will not give “unique constraint violated” error.
Conclusion:- The above mentioned solution will get you rid of ‘Unique Constraint Violated’ Error
This solution worked in my case. I hope it works for you as well.
Thanks & Regards,