on 01-30-2008 5:33 AM
Hi all,
does anyone know how to protect quantity receipt not more than outstanding PO quantities?
for example, in my PO i have 20 pcs. then i only received 5 pcs in my first GRPO. so, the open PO quantity will be 15 pcs.
i need a protection message appear when i receipt more than 15 pcs in my next GRPO.
we tried to using stored procedure for this case, but that procedure also protect partial receipt.
does anyone can sharing with me about this case?
please help me. it's very urgent.
thanks
sisca
Sisca
Stored Procedure is the only way and I am sure it can be done. Please paste your original Stored proc code here and I will take a look.
Check this out
SELECT T0.BaseEntry, SUM(T0.Quantity) FROM [dbo\].[PDN1\] T0 INNER JOIN [dbo\].[POR1\] T1 ON T1.DOCENTRY = T0.BASEENTRY
WHERE T0.BaseType = 22 AND T0.ItemCode = T1.ItemCode AND T0.BaseLine = T1.LineNum
GROUP BY T0.BaseEntry
HAVING SUM(T0.Quantity) < SUM(T1.Quantity)
Suda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi..
eh sisca, nemu jg. kok jauh2 sih..:p
_____________________________________________________________________________________
DECLARE @numlinii int
-
-- ADD YOUR CODE HERE
IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'20')
BEGIN
SELECT @numlinii = (LineNum + 1) FROM PDN1
WHERE PDN1.DocEntry = @list_of_cols_val_tab_del AND
((Quantity > BaseOpnQty))
ORDER BY LineNum ASC
IF (ISNULL(@numlinii, 0) <> 0)
BEGIN
SET @error = 10
SET @error_message = N'YunPho TOP Bgt ' + CONVERT(nvarchar(4), @numlinii) + N' is invalid !'
--GOTO error_mesg
END
_______________________________________________________________________________________
HTH,
Yun Pho
Edited by: Yun Pho on Jan 30, 2008 2:17 PM
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.