Skip to Content
author's profile photo Former Member
Former Member

Sales Document getting saved even after error message

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 09:25 AM

    Hi Srinivas,

    Use EXIT after the message, then your problem must be solved.

    Regards,

    Kranthi Namala,

    91 99860.35735.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 09: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,

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.