Goods receipts not yet invoiced (GRPO to A/P)
Open goods receipt PO rows that no A/P invoice has closed yet, with open quantity and open value per vendor.
Tool
SELECT T0.DocNum, T0.DocDate, T0.CardCode, T0.CardName, T1.ItemCode, T1.Dscription AS ItemName, T1.Quantity, T1.OpenQty, CASE WHEN T1.Quantity = 0 THEN 0 ELSE T1.LineTotal * T1.OpenQty / T1.Quantity END AS OpenValue, DATEDIFF(day, T0.DocDate, GETDATE()) AS DaysOpen FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.CANCELED = 'N' AND T1.LineStatus = 'O' ORDER BY T0.CardCode, T0.DocDate
SELECT T0."DocNum", T0."DocDate", T0."CardCode", T0."CardName", T1."ItemCode", T1."Dscription" AS "ItemName", T1."Quantity", T1."OpenQty", CASE WHEN T1."Quantity" = 0 THEN 0 ELSE T1."LineTotal" * T1."OpenQty" / T1."Quantity" END AS "OpenValue", DAYS_BETWEEN(T0."DocDate", CURRENT_TIMESTAMP) AS "DaysOpen" FROM OPDN T0 INNER JOIN PDN1 T1 ON T0."DocEntry" = T1."DocEntry" WHERE T0."CANCELED" = 'N' AND T1."LineStatus" = 'O' ORDER BY T0."CardCode", T0."DocDate"
What this query answers
At month end the accountant needs every goods receipt that no vendor invoice has closed yet, to accrue the cost and chase missing invoices. This returns each open goods receipt PO row with the vendor, item, received and still-open quantity, the open value and how many days the receipt has been waiting for an A/P invoice.
Sample output
Illustrative demo values. Your columns are the same; the numbers come from your company.
| DocNum | DocDate | CardCode | CardName | ItemCode | ItemName | Quantity | OpenQty | OpenValue | DaysOpen |
|---|---|---|---|---|---|---|---|---|---|
| 612 | 2026-09-18 | V10000 | Global Parts Co. | A00004 | Paper A4 Box | 200 | 200 | 1800 | 53 |
| 620 | 2026-10-02 | V20000 | Metro Packaging | A00007 | Carton 40x30 | 500 | 150 | 375 | 39 |
| 631 | 2026-10-21 | V23000 | Prime Logistics | A00001 | Laser Printer 1420 | 10 | 10 | 2100 | 20 |
| 640 | 2026-11-03 | V10000 | Global Parts Co. | A00003 | Toner Cartridge Color | 60 | 60 | 1260 | 7 |
SQL Server vs SAP HANA
The CASE guard and the DATEDIFF change as on other pages: DATEDIFF(day, T0.DocDate, GETDATE()) becomes DAYS_BETWEEN(T0."DocDate", CURRENT_TIMESTAMP). Quote "OpenQty" and "LineStatus" exactly.
Common errors and fixes
- A receipt still shows after the vendor invoice was posted: The A/P invoice must be copied from the goods receipt (Copy From), not keyed by hand. A manual invoice does not close the GRPO row, so close it or reconcile the two.
- Returned goods are still listed: A goods return copied from the receipt lowers OpenQty. If the return was created without a base document, the GRPO row stays open.
- Open value is in the wrong currency: LineTotal is in local currency. Use TotalFrgn instead for the document currency.
Need this report built into SAP Business One?
A saved query answers the question once. We do SAP Business One development: add-ons, integrations and reports, from the database to the screen. Or hire a remote SAP Business One developer for the whole job, fixed price per phase.
Related queries
Table reference: OPDN table (Goods Receipt PO (header)) · PDN1 table (Goods Receipt PO (rows))
Three steps, no signup
Copy the right version
Use the SQL Server tab for MS SQL databases and the HANA tab for SAP B1 on HANA.
Open Query Generator
In SAP Business One go to Tools → Queries → Query Generator, paste and click Execute.
Save and share
Click Save, pick a category and give the query a name. Your team can run it from Query Manager.
Questions about this tool
How do I run the goods receipts not yet invoiced (grpo to a/p) query in SAP Business One?
Copy the version that matches your database, open Tools → Queries → Query Generator, paste it in the SQL box and click Execute. Save it to reuse it later.
Which tables does this query use?
It reads OPDN, PDN1 from the standard SAP Business One schema. No user-defined fields are needed.
Can this be turned into a dashboard or alert?
Yes. We turn queries into Crystal reports, Excel reports that refresh themselves, SAP B1 alerts or WhatsApp messages for managers.
Built for SAP Business One teams
Need this inside SAP Business One?
We build add-ons, reports and integrations for SAP B1 on SQL Server and HANA. Tell us what you need and get a fixed price, usually within 24 hours.
