Message type: E = Error
Message class:  KZ - Cost Object Repetitive Mfg / Process Mfg 
Message number: 165
Message text: Object not assigned to & & - cannot delete
You are attempting to delete a single object from the assignment to
&v1& &v2&, but the object is not assigned.
The single object is not deleted.
The system issues an error message and will not allow you to continue with this transaction until the error is resolved.
Error message extract from SAP system. Copyright SAP SE.
The SAP error message KZ165 ("Object not assigned to & & - cannot delete") typically occurs when you attempt to delete a master data object (like a cost center, internal order, or other controlling objects) that is still assigned to other objects or transactions in the system. This is a safeguard to prevent the deletion of objects that are still in use, which could lead to data integrity issues.
Cause:
Active Assignments: The object you are trying to delete is still assigned to other objects or transactions. For example, a cost center may be assigned to a profit center or a controlling area.
Open Transactions: There may be open transactions or postings related to the object, preventing its deletion.
Dependencies: The object might have dependencies that need to be resolved before deletion can occur.
Solution:
To resolve the KZ165 error, you can follow these steps:
Check Assignments:
Use transaction codes like KSB1 (Cost Centers: Actual Line Items) or Get instant SAP help. Sign up for our Free Essentials Plan.
Get instant SAP help. Sign up for our Free Essentials Plan. 
KZ164 Maximum number of single objects reached - no more assignments possible
What causes this issue?  &v2& single objects are already assigned to <DS:GLOS.cost_object_ID>cost object ID</> &v1&. This ...
KZ163 & & will be settled to & - assignment not possible
What causes this issue?  You are attempting to assign &v1& &v2& to a cost object hierarchy that is to be settled according to material...
KZ166 Assignment of single object to cost object &v1& not allowed
What causes this issue?  <DS:GLOS.cost_object_ID>Cost object ID</> &v1& has the <DS:GLOS.cost_object_category>cost object ca...
KZ167 DO NOT USE
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
Click on this link to search all SAP messages.