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.
thanks a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mona,
Here is an alternative beside previous answer:
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
Rgds,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this code in the Transaction notification stored procedure:
IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'20')
BEGIN
declare @numlinii int
SELECT @numlinii = (LineNum + 1) FROM PDN1
WHERE PDN1.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'Line ' + CONVERT(nvarchar(4), @numlinii) + N' is invalid !'
end
END
(It is from an old forum thread.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.