Skip to Content
Jan 22, 2015 at 04:15 PM

ORDER_SAVE-CHECK_BEFORE_SAVE BADI not stopping the process on DO_NOT_SAVE event



I am trying to implement the custom validation on CRM Sales Order from Web UI to restrict the limited number of orders per customer in a given day and on exceeding the limit order is not allowed to be saved and an error message should be issued.

To achieve this, I have chosen to implement the BADI ORDER_SAVE and method CHECK_BEFORE_SAVE. In case of validation failure I am raising DO_NOT_SAVE event along with adding message using add_message method & setting the flag CV_OWN_MESSAGE as true.

This code is working fine, if I press "Enter" before save action and stopping the process by issuing the error message. In case, if I directly click on "Save" without "Enter" action, order is getting saved successfully along with issuing error message. Ideally, it should issue error message and stop the save action.

It is very strange to see such behavior in SAP CRM 7.0. If any of you encountered the same situation please provide your inputs or please suggest if there is any alternative way to achieve this validation.

Thanks in advance.