12-09-2009 11:57 AM
Dear All,
I have maintained minimum order quantity for a mterial in material master so that I should not raise sales order less than that quantity, it is also fine we are able to succeed in that.
But my requiremnt is I should put the sales quantity in multiples of minimum order quantity which I have maintained in the MMR.
Say for an example for Material A, I have maintained miimum order quanity as 4. If I rasie sales order for less than 4 it will through error, this has ben done. But next quanities I can be maintianed as 8, 12, 16, 20....... like this.
Currently system is throwing error ir I put quantiy less than 4. But error message need to through if I put quanity as 5,6,7,9,10,11,13......... like this, HOW CAN I ABLE TO DO THIS?
Kindly provide me any user exit is there for this issue to get resolve.
Rgds
Srini
12-09-2009 1:14 PM
I did this once, but I think it was in SAVE_DOCUMENT_PREPARE in MV45AFZZ. That may not be the ideal spot for you, since you're at SAVE button press when that is invoked (last thing you can do to the data in the order). Check various subroutines in includes beginning with MV45AF*Z...look at the includes for SAPMV45A with the SE80 tool...you'll see the possible exit includes listed in the includes folder/list. Unlike CMODs or enhancement points, etc., in SD these exit routines are already "activated".
Essentially, what I did was divide the quantity by the min order quantity, and then look for a remainder....something like:
f1 = vbap-(quantity field) / mm-minorderqty. (gives me a type I value)
f2 = f1 * mmminorderqty. (another type I value).
If F1 <> f2... "there's a qty that is not exact multiple.
message about exact multiples of order quantity with the POSNR value (VBAP item row).
Don't forget to enforce a vbap qty that is at least minimum order qty.
12-09-2009 1:36 PM
Check your order position quantity in USEREXIT_CHECK_VBAP.
fieldA = orderquantity MOD minimum_quantity.
if fieldA ne 0.
* fire off your message and other stuff to deny the position
endif.
12-10-2009 5:06 AM