Skip to Content
0
Former Member
Nov 25, 2009 at 09:32 AM

Validation If unit price of GRPO is different from PO

65 Views

Hi,

I am trying to assign 1 validation for scenario mentioned in the subject. The validation which i have tried is showing me error even if i have not changed the unit price at the GRPO level.

IF @transaction_type IN (N'A', N'U') AND

(@Object_type = N'20')

begin

if exists (SELECT T1.[Price], T3.[Price] FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry

INNER JOIN OPOR T2 ON T2.DocEntry=T1.BaseEntry INNER JOIN POR1 T3 ON T2.DocEntry = T3.DocEntry

WHERE T1.ItemCode=T3.ItemCode And T1.[Price]<>T3.[Price])

Begin

select @Error = 10, @error_message =

'UNit price is different from PO'

Regards-

Monica.