
When sales orders are raised, Users may deliver more quantity than the quantity in the sales order. To prevent this, use the query below to block posting. The system will generate an error message to warn the user. Follow the path to post the query:
Login to Microsoft SQL Server Management Studio
-
- Expand Databases.
- Expand Your Database in this case (SVTL2022).
- Expand Programmability.
- Expand Stored Procedures.
- Scroll down to dbo.SBO_SP_TransactionNotification.
Right Click on dbo.SBO_SP_TransactionNotification
6. Click Modify
7. Paste Query in the section indicated above “Insert your query here”
8. Click Execute ——-Delivered Quantity cannot be more than Sales order Quantity IF @transaction_type IN (N’A’, N’U’) AND (@Object_type = N’15’)
BEGIN Declare @numlinii int SELECT @numlinii = (LineNum + 1)
FROM DLN1 WHERE DLN1.DocEntry = @list_of_cols_val_tab_del AND ((Quantity > BaseOpnQty)) ORDER BY LineNum ASC IF (not ISNULL(@numlinii, 0) = 0)
BEGIN SET @error = 10 SET @error_message = N’Delivered quantity cannot exceed Sales order quantity ‘ + CONVERT(nvarchar(4), @numlinii) + N’ !’ end
END
I hope this helps. Thank you