Skip to Content

Outstanding PO Query

Oct 04, 2017 at 05:44 AM


avatar image
Former Member

hi all expert,

This query as my outstanding Purchase Order, i get the error in "Received Quantity".

PO no.421 Purchase Item A QTY 800

PO no.422 Purchase Item A QTY 800, GRPO QTY 800

My query show in PO no.421 Purchase Qty 800, Open Qty 800 and Received Qty 800* this Qty 800 is my other PO receiving.


SELECT T0.[CardCode] as [BP Code], T0.[CardName] as [BP Name], T0.[DocNum] as [PO No.], T1.[ItemCode] as [Item No.], T1.[Dscription] as [Description], T1.[Quantity] as [Quantity], T1.[OpenQty] as [Open Quantity], SUM(isnull(T3.[Quantity],0)) as 'Received Qty' FROM dbo.OPOR T0 INNER JOIN dbo.POR1 T1 ON T0.DocEntry = T1.DocEntry LEFT JOIN dbo.PDN1 T3 ON T3.BaseEntry = T0.DocEntry AND T3.BaseLine = T1.Linenum LEFT JOIN dbo.OPDN T2 ON T2.DocEntry = T3.DocEntry WHERE T0.[DocDate] >=[%0] AND T0.[DocDate] <=[%1] AND T0.CardName LIKE '%[%2\]%' AND T1.[OpenQty] >=1 GROUP BY T0.[CardCode], T0.[CardName], T0.[DocNum], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[OpenQty]


os-po-error.png (3.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Johan Hakkesteegt Oct 04, 2017 at 07:31 AM


The query looks correct and your screenshot only show one line with QTY 800.

Please double check that there really is not a GRPO drawn from PO no.421, or that it really is PO no.422 in the query result.



Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I very confirm the PO no.421 not GRPO any Qty. because the open qty as 800.


error.jpg (126.7 kB)

Please show a screenshot of the query result, that shows both document numbers (421 and 422).