cancel
Showing results for 
Search instead for 
Did you mean: 

Check the schedule line prior to save Sales Order

Former Member
0 Kudos

Hi,

Example: If the schedule line date is > 3 months from the Purchase Order date, prompt a message and the Sales Order is not saved.

What userexit to trigger in order to check the schedule line date prior to save Sales Order?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use program MV45AFZZ in SE38 and the user exit which can be used is USEREXIT_SAVE_DOCUMENT

This has to be trigerred at Save only, or you can try USEREXIT_SAVE_DOCUMENT_PREPARE just before saving

Reward if helpful.

Regards

Ravi

Edited by: Ravi D Mansharamani on Mar 25, 2008 9:20 PM

Former Member
0 Kudos

Hi Ravi,

What is the difference between USEREXIT_SAVE_DOCUMENT and USEREXIT_SAVE_DOCUMENT_PREPARE? I already read the explanation in SE38 for the 2 userexits, but am still not clear.

Are both being trigerred at the point when the <SAVE> button is clicked, then followed by all the checking?

Thanks.

Former Member
0 Kudos

Hi Wooi Ling Ng,

USEREXIT_SAVE_DOCUMENT_PREPARE is used by the system just before save. Here the system internally calculates and sees if all the conditions are satisfied just before save. You write all your validations for Sales Order here just when the system prepares for save.

I guess this user exit will help you - USEREXIT_SAVE_DOCUMENT_PREPARE

USEREXIT_SAVE_DOCUMENT is triggerred at save.There are few activities which should only be triggered at save, hence use this exit.

But the most advisable user exit in your scenario is USEREXIT_SAVE_DOCUMENT_PREPARE and should be triggered when the system prepares to save the document.

Hope it helps. Reward points if it does.

Regards

Ravi

Answers (1)

Answers (1)

mandar_shete
Active Participant
0 Kudos

Hi Wooi,

I guess better to use MV45AFZB (USEREXIT_CHECK_VBEP). Its get called before the USEXITE_SAVE_DOC and SAVE_PREPARE. So that the check can done before all the processing of Sales Order.

Thanks,

Mandar

Former Member
0 Kudos

Hi Mandar,

How does this MV45AFZB (USEREXIT_CHECK_VBEP) going to work? At which point is it being triggered? Upon the <SAVE> button is clicked?

So, logics (codes) need to be added to the userexit to perform the checking as per my requirement?

Thanks.