From time to time, the SHOP_MATERIAL_ALLOC_API ends up in invalid state during the DB deployment. It seems to be caused by the parallel deployment of files, and unfortunate circumstances. At the same time as this package is deployed, one of sources to view CTP_SUPPLY_DEMAND is also deployed from another thread, typically it is the Order or Invent threads. Note that view CTP_SUPPLY_DEMAND is included in SHOP_MATERIAL_ALLOC_API.
We cannot find any solution inside the IFS Installer to fix this since the package seems to be stuck in a “limbo state”. Well, not the whole true. It looks like we have fixed the issue from the 22.1 release since the files will be deploy in a different order. Too bad, but this modification cannot be down ported (without a massive work involving all product groups).
What to do if you run into this problem? There is no generic solution but one way to go is splitting the delivery into two. In first place, try to deploy SHOP_MATERIAL_ALLOC_API in a second step.