Open purchase orders by vendor
Open purchase order lines with quantity still to receive, grouped by vendor.
Tool
SELECT T0.CardCode, T0.CardName, T0.DocNum, T0.DocDueDate, T1.ItemCode, T1.Dscription, T1.OpenQty, T1.Price, T1.OpenQty * T1.Price AS OpenValue FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.DocStatus = 'O' AND T1.LineStatus = 'O' ORDER BY T0.CardName, T0.DocDueDate
SELECT T0."CardCode", T0."CardName", T0."DocNum", T0."DocDueDate", T1."ItemCode", T1."Dscription", T1."OpenQty", T1."Price", T1."OpenQty" * T1."Price" AS "OpenValue" FROM OPOR T0 INNER JOIN POR1 T1 ON T0."DocEntry" = T1."DocEntry" WHERE T0."DocStatus" = 'O' AND T1."LineStatus" = 'O' ORDER BY T0."CardName", T0."DocDueDate"
What this query answers
The buyer calls suppliers every week to chase late deliveries, and the warehouse wants to know what is still coming in. This lists every open purchase order line by vendor, with the quantity and value not yet received.
Sample output
Illustrative demo values. Your columns are the same; the numbers come from your company.
| CardCode | CardName | DocNum | DocDueDate | ItemCode | Dscription | OpenQty | Price | OpenValue |
|---|---|---|---|---|---|---|---|---|
| V10000 | Global Parts Co. | 512 | 2026-10-18 | A00005 | Toner Cartridge Black | 100 | 28 | 2800 |
| V10000 | Global Parts Co. | 519 | 2026-11-02 | A00009 | USB Cable 2m | 200 | 2.5 | 500 |
| V20000 | Metro Packaging | 515 | 2026-10-25 | A00007 | Paper A4 Box | 150 | 7.2 | 1080 |
| V23000 | Prime Logistics | 521 | 2026-11-10 | S00001 | Freight Service | 1 | 450 | 450 |
SQL Server vs SAP HANA
Only quoting changes, including the calculated alias "OpenValue". One visible difference: HANA sorts CardName in binary order, so names starting with lower-case letters come after all upper-case names.
Common errors and fixes
- OpenValue mixes currencies: Price is in the line currency, so a EUR line and a USD line are added as if they were the same. Select T1.OpenSum (open line amount in local currency) when you need one comparable total.
- OpenValue is higher than the PO total: Price already includes the line discount, but a header discount (T0.DiscPrcnt) is applied on top of the lines. Multiply by (1 - T0.DiscPrcnt / 100) if your buyers use header discounts.
Need this report built into SAP Business One?
A saved query answers the question once. We build SAP Business One vendor portals: vendors confirm purchase orders and delivery dates, upload invoices as A/P drafts and check payment status. Or hire a dedicated SAP B1 developer for the whole job, fixed price per phase.
Related queries
Table reference: OPOR table (Purchase Order (header)) · POR1 table (Purchase Order (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 open purchase orders by vendor 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 OPOR, POR1 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.
