cancel
Showing results for 
Search instead for 
Did you mean: 

To avoid Duplicate material entry while making sales order by VA01

Former Member
0 Kudos

Sir / Madam,

While making sales order by VA01 , duplicate material also accepted by system .There should be no duplicate material in sales order list.

please suggest solution.

Thanks.

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member380749
Discoverer
0 Kudos

Dear All,

I have found this web page where a code is embedded:

You can issue a warning message to the user by adding some ABAP code to the User Exit called USEREXIT_CHECK_VBAP in the program MV45AFZB.

MV45AFZB

*&---------------------------------------------------------------------*

*&      Form  USEREXIT_CHECK_VBAP

*&---------------------------------------------------------------------*

*                                                                      *

*       This Userexit can be used to add addtional logic for           *

*       checking the position for completeness and consistency.        *

*                                                                      *

*       US_DIALOG  -  Indicator, that can be used to suppress          *

*                     dialogs in certain routines, e.g. in             *

*                     copy mode.                                       *

*                                                                      *

*       This form is called from form VBAP_PRUEFEN_ENDE.               *

*                                                                      *

*----------------------------------------------------------------------*

FORM userexit_check_vbap USING us_dialog.

*---------------------------------------------------------------------*

* Give the user a warning message if a material number has

* already being entered on the sales order.       

*---------------------------------------------------------------------*

LOOP AT xvbap

   WHERE matnr EQ vbap-matnr

         AND posnr NE vbap-posnr

         AND kwmeng NE 0.

   MESSAGE i001(vl) WITH 'Material is already on the order'.

ENDLOOP.

*---------------------------------------------------------------------*

ENDFORM.                    "userexit_check_vbap

Rewards point if it helps

Issuing a warning message when duplicate materials are entered on a sales order |     SAP-Advisor.c...

Best Regards,

Ignacio.

Former Member
0 Kudos

Hi,

You should use userexit USEREXIT_SAVE_DOCUMENT_PREPARE in MV45AFZZ and not USEREXIT_SAVE_DOCUMENT,.The reason behind this is prepare userexit is activated just before saving the document,so at the time of saving if the logic which you will give is not satisfied then you can set warning or error in the code.

Rewards points if useful.

Regads,

Amrish Purohit

Message was edited by:

AMRISH PUROHIT

Former Member
0 Kudos

thanks amrish,

Kishore

knitinkumarsethy
Explorer
0 Kudos

Hi Experts,

How to through the error message here for duplicate entry and enable the field after the error message.

Thank you.

Former Member
0 Kudos

hi kishore,

can u tell me how u solve the problem because i am also dealing with similar kind of problem

can u post them

Regards,

Mahesh Dasari

Former Member
0 Kudos

Use FORM USEREXIT_SAVE_DOCUMENT.

in the include MV45AFZZ

Former Member
0 Kudos

no , how u can u set system not to accept

check

mat qty plant

001 10 PP1

002 20 PP1

0001 20 PP2

S o cannt stop system in this case , if u want then go for user exit .

Regards

Prabhu

Former Member
0 Kudos

hi

At time we should be use Material listing /Exclusion .

Rewards point it helps