“A child row has multiple parents” error

I was trying to add new child row.
I was expecting add new child row
Instead I’ve got The error.

i clicked on a new record in a detachproperties screen .

Entity:

Datastructure:

You cannot model a screen like that. If you want to edit master-detail data, the detail entity has to reference a primary key of the parent entity (or at least a unique key).

The problem here is that CreatedByBusinessPartner is a “leaf” entity, not a child.

The BusinessPartner entity is in fact the parent of your DetachTable. But you placed it as a child.

Imagine you have 2 records in the (now parent) DetachTable. Both will have RecordCreatedBy filled in with your user id, since you created both parent records.

Now what happens when you add a child record to the first entity? It will succeed.
When you try to add a second record, it will try to fill in your user Id into _refDetachTable field. Then which row is a parent of this new row? The first master or the second master? Both have the same parent id.