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

Execute a part of code one time only

Hi experts,

I have a user exit in transaction VA01, when the user enter the transaction and enter a PO number, this is PO is checked if it exist or not, if there is an error or warning message is displayed. (the type of message depanned of value in table on SM30).

That's works perfeclty and the message is displayed just one time.

But when the user enter a material, the user exit is re-launched and the warning message will be displayed again, and that it for all new enter material.

I don't know were and how I can get that parts of code will be executed one time, or to display the warning message jsut one time.

my part of code is like this:

if sy-subrc is initial.
case lw_audat-l_zoff.
when 'N'. "No control


when 'E'.
* Error Message Purchase order number in document number: & already exists
message e115(v4) with lw_vbeln.


when 'W'.
* Warning Message Purchase order number in document number: & already exists
if sy-msgty ne 'W'.
message w115(v4) with lw_vbeln.
endif.

endcase.

* Purchase order number in document number: & already exists
* MESSAGE e115(v4) WITH lw_vbeln.
endif.

The check in SY-MGSTY is here because previously the message was displayed twice.

Regards,

Younes

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jan 14, 2016 at 10:59 PM

    Hello, I suggest you to open a thread in the SD (Sales and Distribution) Forum so they can better help you with transaction VA01. Here is the link: http://scn.sap.com/community/erp/sd Hope to help you with this. BR, Georgia Vanin

    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.