cancel
Showing results for 
Search instead for 
Did you mean: 

Outstanding PO Query

former_member294713
Participant
0 Kudos

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.

os-po-error.png

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]

hooi77

Accepted Solutions (0)

Answers (1)

Answers (1)

Johan_H
Active Contributor
0 Kudos

Hi,

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.

Regards,

Johan

former_member294713
Participant
0 Kudos

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

error.jpg

Johan_H
Active Contributor
0 Kudos

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