Work Center cannot be deleted
Very frequently, problems are observed when deleting a work center on transactions such as CR02, CRC2 or IR02.
The work center can be deleted directly on the mentioned transactions if we choose the menu ‘Work center’ – ‘Delete’ or it can be archived using the archiving object PP_WKC (Archiving Work Centers (PP-BD-WKC) – Production Planning and Control (PP) – SAP Library)
However, very frequently a TIME OUT short dump happens when you try to delete the work center directly on the transaction .
The TIME_OUT dump usually occurs when the tables where the work center is being used are huge. That’s because, during the work center deletion, system must perform a where-used selection, to find on which tables the work center is being referred. This procedure is necessary in order to prevent database inconsistencies, that means, avoid the deletion of a work center that is still being used on another table or transactions.
For example, if the work center was used on a production and if you delete this work center, you would probably observe a short dump or an inconsistency when trying to open this work center.
Therefore, system must confirm that the work center is nor referenced on the following tables, before the deletion:
- PLKO – Task list – header
- AFRU – Order completion confirmations
- EQUZ – Equipment time segment
- IFLO – Functional Location (View)
- AFIH – Maintenance order header
- ILOA – PM Object Location and Account Assignment
- QMEL – Quality Notification
When there is a lot of data on these tables, the performance of this where-used selection is very bad and the work center cannot be deleted.
In this case, the archiving of unnecessary PM orders and Production orders to reduce the size of those tables is extremely recommended. This procedure will reduce the number of entries in the tables and it should avoid the TIME OUT.
In addition, there may be no suitable access path for the select statement on the tables, such as AFRU. This would not normally be an issue if the size of the order tables were not out of hand. However, with the large amounts of data in these tables, the unsuitable access path really is a significant issue. A new table INDEX with the field ARBID can be used, but this is considered as a MODIFICATION. Normally, SAP suggests a MAXIMUM of five indexes for a given table. This minimizes the required tablespace and minimizes the time needed by the Cost Based Optimizer to evaluate the possible access paths.
It is possible, however, to temporarily create the ARBID index, until the size of the order tables can be reduced sufficiently to allow
proper access to these tables or until the deletion of the desired work centers. After that, the index can be removed from the table.
Note 415031 provides more details about this specific issue and the mentioned index.
Another very frequent issue is the error message ‘CR002 – Work center XXXXXXXX in plant XXXX is still being used’.
This error message happens when the work center is still being referenced in one of the mentioned tables and the deletion will not be allowed while such reference still exists.
A quick way to identify where the work center is being referenced is to run transaction CR40 with all the flags checked.
Transaction CR40 will show exactly on which documents the work center is being used and you can proceed with a clean up of these documents.
Only when there is no usage for this work center on transaction CR40 you should be able to delete the work center.
In order to clear the references for this work center, we can replace it on routings and task lists and we should archive existing orders where this work center was used, with a proper archiving object (e.g. archiving object PP_ORDER for production orders).