cancel
Showing results for 
Search instead for 
Did you mean: 

Need TN to Block Incoming Excise Invoice If Series is Different than GRPO

Former Member
0 Kudos

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

Dear

Accepted Solutions (1)

Accepted Solutions (1)

former_member209066
Active Contributor
0 Kudos

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

Former Member
0 Kudos

HI Nithi

Thanks for your Effort it works

Answers (0)