Dear Team,
Below i mentioned my stored procedure for Block production order if there is no stock.
Actually t0.U_stockcbe is a FMS alphanumeric field contains stock in warehouse.But this sp is not working correctly.
please help
IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'202')
if Exists( SELECT T0.[LineNum] FROM WOR1 T0 INNER JOIN OWOR T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.[PlannedQty]>t0.U_stockcbe
and T1.DocEntry= @list_of_cols_val_tab_del )
Begin
Set @error =9
Set @error_message = 'prd Orderd Quantity is greater than Stock!! '
End
End
Regards
Sanu