12-19-2008 9:17 AM
Hi,
I am giving order type in VA01 Tcode and then Clicking on 'Create with Reference' .Then a Pop Up is getting generated. In this i am giving Contract already created (using VA41 Tcode) and then clicking on 'Copy' button.In the generated Screen i am giving quantity at Item Level. When saving, If this quantity exceeds referenced Quantity Contract Quantity i am generating error message by using the Program MV45AFZZ.
IF TOT_QTY1 > V_QTY.
MESSAGE E002(ZMSG2) WITH V_QTY Z_QTY LEFT_QTY1.
ENDIF.
After error message got generated ,if i Save it again,the document is getting saved.But i dont want
the document to get saved if there is error message. Please help how can i do this.
Thanks
K Srinivas
12-19-2008 9:25 AM
Hi Srinivas,
Use EXIT after the message, then your problem must be solved.
Regards,
Kranthi Namala,
91 99860.35735.
12-19-2008 9:22 AM
Hi,
You should put your coding inside routine USEREXIT_SAVE_DOCUMENT_PREPARE or USEREXIT_SAVE_DOCUMENT to avoid document save once an error message occurs.
Cheers,
12-19-2008 9:42 AM
Thanks for the reply.i kept my code in FORM USEREXIT_SAVE_DOCUMENT_PREPARE but first time when i click on SAVE the error message is showing. When i again click on SAVE it is asking 'Would you like to Save or Edit' and when i click on Save the document is getting saved.Please resolve.
12-19-2008 9:47 AM
Hi,
In this case, you may need to put your logic inside routine USEREXIT_SAVE_DOCUMENT, so that the logic will called during saving data.
Hope this help.
Cheers.
12-19-2008 9:25 AM
Hi Srinivas,
Use EXIT after the message, then your problem must be solved.
Regards,
Kranthi Namala,
91 99860.35735.
12-19-2008 9:45 AM
i placed 'Exit' after the message. Even then the problem is not resoved.Please help.
Thanks
K Srinivas
12-19-2008 9:53 AM
Thanks for the reply. Its working after placing the Exit after statement.