0% found this document useful (0 votes)
472 views2 pages

Sales Order Enhancement

This document discusses issuing a warning message in SAP when duplicate materials are entered on a sales order. It provides an example of ABAP code that can be added to a user exit to check if the material number already exists on another line of the sales order and notify the user if so. Notifying the user of duplicate materials allows them to easily update the quantity on the existing line instead of creating unnecessary duplicates.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
472 views2 pages

Sales Order Enhancement

This document discusses issuing a warning message in SAP when duplicate materials are entered on a sales order. It provides an example of ABAP code that can be added to a user exit to check if the material number already exists on another line of the sales order and notify the user if so. Notifying the user of duplicate materials allows them to easily update the quantity on the existing line instead of creating unnecessary duplicates.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Issuing a warning message when duplicate

materials are entered on a sales order


Posted by Wayne on December 17, 2009

Introduction
Although SAP allows a material number to be entered on a sales order more than once, in some cases this is not
considered best practice for many businesses. Often, this can cause confusion with the customer and is best
corrected by updating the quantity on the existing order line instead of entering duplicate materials on the order.

ABAP Warning Message


Duplicate material numbers on a sales order can easily be solved by the user if a simple warning message is
provided which notifies them that the material number is already on the order. The user can then take steps to
correct the quantity on the existing order line instead of adding the same material to the order again.

User Exit for Sales Orders


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. I have given an example below which simply checks to
see if the material number already exists on the order but on a different sales order line. It also checks to see if
the cumulative order quantity is zero.

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

Conclusion
Duplicate materials on a sales order can be easily resolved by simply notifying the user that the material already
exists on the sales order. The user can then taken corrective action by updating the quantity on the original
material order line

You might also like