Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Billing / delivery document should not processed further without attach pdf file in VA02.

former_member510894
Participant
0 Kudos

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.

7 REPLIES 7

raymond_giuseppi
Active Contributor
0 Kudos

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)

  • Setting some status in the VA02
  • Checking it in VF01/VL01N/etc.

former_member510894
Participant
0 Kudos

User Exit MV45AFZZ is used only for sales order creation but we need at time of Billing / delivery document save.

VeselinaPeykova
Active Contributor

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. 🙂

0 Kudos

Exactly. Rather silly requirement that can be worked around too easily.

rajkumarnarasimman
Active Contributor
0 Kudos

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

former_member510894
Participant
0 Kudos

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).

0 Kudos

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