on 12-09-2014 7:03 AM
Dear Experts,
we are having multiple Series for Document so we need to block Incoming Excise Invoice If Series is Different than GRPO
Some Work around but not working
IF (@object_type = '140000010' AND @transaction_type in (N'A', N'U') )
BEGIN
declare @Series2 NVARCHAR(20)
set @Series2 = (SELECT distinct T1.SeriesName FROM OIEI T0
INNER JOIN NNM1 T1 ON T0.Series = T1.Series
where T0.DocEntry = @list_of_cols_val_tab_del )
declare @Series3 NVARCHAR(20)
set @Series3 = (SELECT distinct T4.SeriesName FROM OIEI T0
Inner join IEI1 t1 on T0.DocEntry=t1.DocEntry
inner join PDN1 t2 on t2.TrgetEntry=T0.DocEntry and t2.LineNum = t1.BaseLine
inner join OPDN t3 on t2.DocEntry=t3.DocEntry and T3.DocEntry=t1.Baseentry
INNER JOIN NNM1 T4 ON T4.Series = T3.Series
where T0.DocEntry = @list_of_cols_val_tab_del and t1.basetype=20 )
If @Series2!=@Series3
Begin
Set @error =1
set @error_message = 'Please Select Proper Series as GRN'
SELECT @error , @error_message
END
END
Thanks & Regards
Navanath
Hi,
Please check this SP
IF (@object_type = '140000010' AND @transaction_type in (N'A', N'U') )
BEGIn
if(SELECT distinct COUNT(*) FROM OIEI T0
INNER JOIN NNM1 T1 ON T0.Series = T1.Series
where T1.SeriesName<>
(Select Distinct C.SeriesName from PDN1 A INNER JOIN
OPDN B ON A.DocEntry=B.DocEntry
INNER JOIN NNM1 C ON B.Series=C.Series
INNER JOIN IEI1 D ON A.DocEntry=D.BaseEntry Where D.DocEntry=@list_of_cols_val_tab_del )
and T0.DocEntry = @list_of_cols_val_tab_del )>0
begin
Set @error =1
set @error_message = 'Please Select Proper Series as GRN'
SELECT @error , @error_message
END
END
Thanks,
Nithi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
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.