Hi guys - my team have the following question: we have some IMOs without material lines. And they are open, which bugs us - how can we get these deleted or cancelled?
Do I just change the status of the IMO in the database? Or can the end user do something themselves?
Page 1 / 1
Hi Bjørn,
Short answer for the specific scenario you presented, assuming you wish to remove these IMO documents, the user should be able to delete them from the UI with this option:
Screen is from 15.2 which I presume you users are still using. As there are no material lines and the status is Open, the delete option is available. I just confirmed this on a copy of your database here with the above IMO.
Little more advice
If the status is Open and there are material lines, you will be asked a question about the changing the status of the original demands (if linked to a service order for example). In cases you have provided to me in the past, this might happen where the product was finally shipped with a different IMO but the original IMO is still present and both are somehow linked to the same demand_id in the demand_material table. If this should happen with a different IMO fulfilling the demand, then answer the question you do not want to change the status.
There is something strange with these, as they cannot be deleted:
Ok, then there is no logistic order line linked to the SV2103150035@@1 service order. At this point, you cannot delete it from the UI but you can look for it in the logistic_order table.
Use the following query to confirm the row exists in this table and is the one that should be removed.
SELECT dm.order_id, dm.orig_doc_id, lo.logistic_order_id, lo.* FROM logistic_order lo WITH(NOLOCK) LEFT OUTER JOIN demand_material dm WITH(NOLOCK) ON dm.order_id = lo.logistic_order_id WHERE dm.order_id IS NULL AND lo.ldmnd_stat_id = 0 AND lo.logistic_order_id = 'SV2103150035@@1-1'
Please only do this on a copy of your database and validate the results are what you need before applying to production.
If the first column (order_id) is empty, there are no demand_materials though you have a logistic_order that is status Open (ldmnd_stat_id = 0).
Concluding, if you cannot delete IMO, you need to remove the logistic_order_line when there are no material lines.