Hi,
I was too looking for such a query and built one based on this discussion.
Given below,
But I found that my query reports the balance quantity correctly BUT does not report the balance amount correctly. I found that balance amount being reported is same as the original order amount.
I checked the raw table in query builder insie SAP B1, and found that the table RDR1 shows full amount as outstanding.
I am using Ver 9.10 (9.10.150 PL 05).
Is it some bug in SAP B1? Or I am not referring to correct field while querying?
Any comment/help will be highly appreciated.
Regards
Anil
SELECT | T0.[docentry], |
T0.[CardCode], | |
T0.[CardName], | |
T0.[Ref1], | |
T0.[DocDate], | |
T0.[DocDueDate], | |
T0.[NumAtCard], | |
T0.[U_BPRefDate], | |
T0.[DocTotal], | |
T1.[U_CustPOSrNo], | |
T1.[ItemCode], | |
T1.[OrigItem], | |
T1.[U_IT1], | |
T2.[SWW], | |
T2.[SUPPCATNUM], | |
T1.[VendorNum], | |
T1.[U_bpcatext], | |
T1.[SubCatNum], | |
T3.[FIRMNAME], | |
T1.[Dscription], | |
T1.[Quantity], | |
T1.[UseBaseUn], | |
T1.[PriceBefDi], | |
T1.[DiscPrcnt], | |
T1.[LineTotal], | |
T1.[OpenQty], | |
T1.[OpenSum], | |
T1.[TaxCode], | |
T1.[VatSum], | |
(T1.[OpenSum]+T1.[VatSum]) as 'Gross' |
FROM ORDR t0
inner join rdr1 t1 on t1.docentry = t0.docentry
INNER JOIN OITM T2 ON T2.ITEMCODE = T1.ITEMCODE
INNER JOIN OMRC T3 ON T3.FIRMCODE = T2.FIRMCODE
WHERE T1.OPENQTY > 0
ORDER BY T0.CARDCODE, T0.[U_BPRefDate]