E: Manual Receipt: Check Min. and Max. Quantity

In Manual Receipt window for work order for receipt assembly the system don't check minimal

This is only working in "Material issue window"

 

It's possible to execute the check with bsl WorkorderBoM/CheckMinMax

Idea: Check issue Quantity while insert receipt quantity

 

What we're checking:

 

Needed Quantity = the input quantity + all receipts from past

 

Related to this quantity the system has to calculate the Plan-Quantity
and based on this the minimum and maximum quantity.

 

mw_manuell_buchen.src

beasscript-logo-small

global function dw_1_item_menge_itemchanged 
dec lc_bookedQty
// Work order - Bill of Material position must be defined
if <dw_1.item.belnr_id.value> n> 0 and <dw_1.item.belpos_id.value> n> 0 and <dw_1.item.pos_id.value> n= 0 and <dw_1.item.menge.value> n> 0 then
   
   // Get booked Quantity
   // Parameter with [] because inside placeholder
   // comma in placeholder not allowed. Use | as comma
   lc_bookedQty=<bsl.WorkorderPos([dw_1.item.belnr_id.value]|[dw_1.item.belpos_id.value]).QuantityProduced/$value>
   lc_bookedQty=<lc_bookedQty,dbnum> + <dw_1.item.menge.value,dbnum>
   
   // Execute BSL function
   instance bsl b
   b.get=WorkorderBom/CheckMinMaxBom(<dw_1.item.belnr_id.value>,<dw_1.item.belpos_id.value>,0,"",<lc_bookedQty,dbnum>,true)
   // if locked, then set quantity to 0
   if <b.Status> = locked then
     dw_1.item.menge.setvalue=0
   end if
   destroy=b
   
end if
end global

 

 

help-hinweis Example Notes