Symptom
You are trying to delete a code in a code group in Edit Code Groups app. However, you get the error message Q3221 "Code *** is being used and cannot be delete".
Usually, the "Usage Indicator" is ticked for the code and you can see that it is used in some selected sets in the "Where-Used List". However, even after you have deleted them in the corresponding selected set, the same error still happens.
Environment
SAP S/4HANA Cloud Public Edition
Cause
This is the standard system behavior.
The physical deletion of used codes in the database is not allowed to avoid data inconsistencies in other applications. If, for example, a code was being used in a message and if you were deleting this code, the system then could not display the short text of the code in the message anymore.
Resolution
Instead of deleting the codes, please deactivate the usage of the code group by set the deletion flag on it. In this way, the codes cannot be used in new objects.
Keywords
QS3221, Edit Code Groups, selected set, Usage Indicator, code group, deletion flag, QS41 , KBA , QM-PT-BD-CAT-2CL , Catalog (Public Cloud) , Problem