on 10-18-2008 12:05 PM
Hi Experts,
I need a Query in such a manner that it should not allow me to add the GRPO if GRPO Qty exceeds.
Reply.
Mona.
Hi,
you could use a SP_TN (store procedure transaction notification) to block the creation of GRPO if the quantity is exceeded the base quantity created in PO.
Here it is :
IF @transaction_type IN (N'A', N'U') AND
(@Object_type = N'20')
begin
if exists (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
and T0.DOCENTRY = @list_of_cols_val_tab_del
GROUP BY T0.BaseEntry
HAVING (SUM(T0.Quantity) > SUM(T1.Quantity))
or sum(t0.quantity) > sum(t0.BaseOpnQty))
begin
select @Error = 10, @error_message =
'GRPO quantity is over PO quantity'
end
end
There is not need to create UDF or use SDK code.
Rgds,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
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.