Skip to Content
avatar image
Former Member

PO qty more or less

Hi All,

I need the system to trigger an approval procedure if the GRPO qty is more or less than the PO qty, If its the same, then there should be no trigger.

I checked this thread:

get-excess-quantity-from-purchase-order-quantity

But it triggers approval for every GRPO. Please assist.

Thanks,

joseph

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 23, 2010 at 04:40 AM

    Hi Joseph,

    The correct query is like this:

    SELECT Distinct 'TRUE'

    FROM dbo.PDN1 T0

    INNER JOIN dbo.POR1 T1 ON T0.BaseENtry = T1.DocEntry AND T0.BaseLine = T1.Linenum

    INNER JOIN dbo.OPDN T2 ON T2.DocEntry = T0.DocEntry

    WHERE T1.Quantity != $[$38.11.number\] AND T1.ItemCode = $[$38.1.0\] AND T2.DocNum = $[$8.0.0\]

    Thanks,

    Gordon

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Gordon,

      The query suggested by Taimoor works in my case.

      Declare @OpenPOQty numeric(19,6)

      Declare @documentQty numeric(19,6)

      set @documentQty=$[$38.11.Number]

      set @OpenPOQty=(select opencreqty from por1 where docEntry=$[$38.45.Number] and lineNum=$[$38.46.Number])

      select distinct 'true' where @documentQty>@OpenPOQty

      Thanks,

      Joseph