cancel
Showing results for 
Search instead for 
Did you mean: 

Execute a part of code one time only

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

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