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?