Define a sorted or hashed itab with a three part primary key and a unique secondary key (hashed or sorted) consisting of just the third component of the primary key.
Insert a duplicate on the primary key - you'll see that SAP gives you a sy-subrc of 4 - it doesn't short dump
But now insert a duplicate on the secondary key, but NOT the primary key - you'll see that you short dump !!!! LOL !!!!!!!
Apparently, SAP only checks primary keys for uniqueness when determining the initial return code. So, since this code will be 0 when the primary key doesn't duplicate, SAP lets the record through and then short dumps on the duplicate for the secondary key.
Of course, it would be nicer if SAP checked ALL unique keys (secondary as well as primary) up front ....
... but we all know SAP has bigger fish to fry like making sure the latest gizmo can talk to SAP, etc.