To check if department/location is referenced in WIP, run the following query:
select project_code from ppa_wip
where DEPARTCODE = 'YOUR_DEPARTMENT_CODE'
or EMPLYHOMEDEPART = 'YOUR_DEPARTMENT_CODE
or PROJECT_DEPARTMENT ='YOUR_DEPARTMENT_CODE
group by project_code
If it returns a non-zero value, then the reference exists
The only time a record is removed from the WIP is when the purge Financials Tables job is run against the project. The job Permanently deletes financials plans and financials transactions (WIP) from the selected project. WIP reversal, adjustment, or transfer will not do it
To see if any investment or resources are associated with the department or location:
Go to the Department or Location properties page > Investments tab, click 'Show All; repeat the same on the Resources tab.
On any investment or resource instance shown on the tabs, you can change the department and location values from the financial properties page. For investments you can only change the department to another one within the same entity if the investment has any financial plan; ensure this investment doesn't have any transaction on the invalid transactions page or waiting to be posted to WIP.