I need to delete HU assignment in an outbound delivery. I followed couple of other SCN as well.
https://answers.sap.com/questions/11484078/function-modules-to-unassign-hu-from-a-outbound-de.html
https://answers.sap.com/questions/13501162/abap-unassign-handling-unit-hu-from-outgoing-deliv.html
https://answers.sap.com/questions/10105526/function-modulebapi-to-delete-assignments-as-vl02n.html
I am calling the FM's, in this order.
1. HU_PACKING_REFRESH - initialise internal HU data
2. HU_GET_HUS - get HU numbers and initialise internal data
3. V51P_DELETE_RELATIONSHIP - delete assignment from delivery. Fill parameter it_hus with it_venum from previous FM
4. HU_POST
5. BAPI_TRANSACTION_COMMIT
Its removing the HU from the overview screen but the history is available in VEVW table and the history tab of HUMO txn.
What is the right way to get the assignment deleted?