Hi all,
I'm implementing a certain logic in SAPMV50A / USEREXIT_SAVE_DOC_BEFORE_PREP during delivery creation (VL01N) to check if delivery items really can be delivered or not. According to note 415716 (example_3) I've implemented the logic to delete delivery items by calling xlips_loeschen(sapfv50p), that works fine.
In special cases the item deletion can cause the situation that a all items are deleted from the delivery. In that case SAP creates a 'empty' delivery document without any item lines.
Question: How can I delete or flag the delivery header for deletion (or non-creation), so that no empty delivery will be created? In dialog mode I guess I could raise a error message but I need also a logic for the delivery creation in batch mode where only some of the deliveries in table XLIKP should not be created. Setting the update flag (XLIKP-UPDKZ) directly in XLIKP or using XLIKP_LOESCHEN/LIKP_LOESCHEN(SAPFV50k) did not help.
Thanks for your thoughts on this in advance!
Oliver