Skip to Content
author's profile photo Former Member
Former Member

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

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
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 09, 2014 at 07:12 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.