There is no programme to do this automation. You need to do manually.
to ease the job, you can use data load classic tool (www.dataload.com, free) and
- download your segments and code combinations using the unwanted segments into spreadsheet format
- modify spreadsheet according to your requirements (set enabled flag to 'N')
- upload the modified spreadsheets to your database (to make sure it works, TEST it thoroughly on Test instance)
As per how FNDLOAD uploads value set values, you could use the following API to disable not used departments:
what about existing balances in those juck departments? is there any open PO's/releases are existing in those juck departments?.
before disabling first do appropriate transfers, then update Open PO's/Replease with new Code Combinations id's.
what is the need to clean up those unused 500 Values ... you can disable/end date those values so that they cannot be used for performing configurations or transactions ...
If no transactions have ever happened, one can replace the value set used for Cost center with a new one ....
He mentioned they are not used that's why I did not mentioned the consideration but you are right, there are consequences if transactions in flight use them.
There is nothing like a clean up that can be done and values cant be deleted.
All that you can do is disable the unused values.
If that seems a big task, create a new value set and assign it to department.
Thank you Abhi27 and every one for responding to this thread. I ended up manually deactivating them.