cancel
Showing results for 
Search instead for 
Did you mean: 

SP for Landed Cost

former_member505219
Participant
0 Kudos

I want to block any inventory transfer of any item where GRPO does not have landed cost assigned.

IF @transaction_type IN ('A','U') AND @Object_type = '67'

BEGIN

   

    Declare @GRPO VARCHAR (50);

   

    SELECT    @GRPO=t0.DocNum   FROM OPDN T0  INNER JOIN PDN1 T1 ON

    T0.DocEntry = T1.DocEntry

WHERE T0.[OpenForLaC] ='Y' and T1.[ItemCode]=@list_of_cols_val_tab_del

   

    IF  ISNULL(@GRPO, '') <> ''

    BEGIN

        SELECT @Error = 22, @error_message = '[' + @GRPO + '] have No Landed Cost.'

    END

END

But this SP is not getting fired  or it is not blocking any inventory transfer. Can you please guide me what error is there?

Accepted Solutions (1)

Accepted Solutions (1)

KennedyT21
Active Contributor
0 Kudos

Hi Muhammad Aftab ..

There is not direct link between the GRPO and Transfer can you explain the link.

If you want to block the Transfer without frieght try this

IF @Object_type = '67' and @transaction_type in ( 'A' ,'U')

BEGIN

If exists

( SELECT  T0.DocNum   FROM OWTR T0 

INNER JOIN WTR T1 ON T0.DocEntry = T1.DocEntry

WHERE  isnull(TotalExpns,'')=''  and  T1.DocEntry =@list_of_cols_val_tab_del

)

Beign

Select @error = 1,

@error_message = 'have No Landed Cost!'

END

End


Regards

Kennedy


Answers (0)