01-16-2018 4:43 AM
we have a requirement to attach .pdf file in VA02 through service for objects for sales order.
Billing / delivery document should not processed further without attach pdf file in VA02.
Please help to how to achieve above requirement using user exit / BADI.
01-16-2018 7:01 AM
Did you try to use the classic user exit USEREXIT_SAVE_DOCUMENT_PREPARE (MV45AFZZ) to check for attachment(s) using some method like CL_BINARY_RELATION=>READ_LINKS (not bypassing buffer)
01-16-2018 8:15 AM
User Exit MV45AFZZ is used only for sales order creation but we need at time of Billing / delivery document save.
01-16-2018 9:01 AM
Speaking without looking in a system, I would consider making use of user statuses in SD documents (setting the status allowing delivery creation should be via custom code) and manual setting of this status by end users would be restricted via authorizations.
Edit: I hope that the business is aware that checking for teh existence of a pdf attachment is not the same as ensuring that the correct document is attached. 🙂
01-16-2018 10:05 PM
Exactly. Rather silly requirement that can be worked around too easily.
01-16-2018 12:15 PM
Hi Sunil,
During sales order creation or change operation, hope we can assign delivery block(VBAK-LIFSK) and billing block(VBAK-FAKSK) in above exit MV45AFZZ based on the condition whether the document is attached or not. By doing so, the system won't allow delivery(VL01N) and billing(VF01) process.
Delivery and BIlling Block in Sales Order(VA02) under Sales Tab:
Regards
Rajkumar Narasimman
01-23-2018 2:34 AM
Yes but in MV45AFZZ how to know document is attached or not. so that we can assign delivery block(VBAK-LIFSK) and billing block(VBAK-FAKSK).
01-23-2018 6:36 AM
Hi Sunil,
Check the internal table XDRAD inside exit USEREXIT_SAVE_DOCUMENT_PREPARE (MV45AFZZ) whether the attachment is available or not.
If the document record is available inside XDRAD, as told before set the delivery block(VBAK-LIFSK) and billing block(VBAK-FAKSK).
Regards
Rajkumar Narasimman