Start a project

Open sales orders with open quantity

Every open sales order line that still has quantity to deliver.

Tables: ORDR, RDR1Use: Daily dispatch planning and backorder follow-up.

Tool

SELECT T0.DocNum, T0.DocDate, T0.DocDueDate, T0.CardCode, T0.CardName,
  T1.ItemCode, T1.Dscription, T1.Quantity, T1.OpenQty, T1.WhsCode
FROM ORDR T0
INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.DocStatus = 'O' AND T1.LineStatus = 'O' AND T1.OpenQty > 0
ORDER BY T0.DocDueDate, T0.DocNum
Need your UDFs in this report, or a dashboard? We extend it for your company.Customize it →

What this query answers

Every morning the warehouse lead asks what still has to ship and what is already late. This list shows each order line with quantity left to deliver, sorted by the promised delivery date so the oldest promises come first.

Sample output

Illustrative demo values. Your columns are the same; the numbers come from your company.

DocNumDocDateDocDueDateCardCodeCardNameItemCodeDscriptionQuantityOpenQtyWhsCode
41022026-10-122026-10-20C20000Acme TradingA00001Laser Printer 142010401
41082026-10-152026-10-24C40000Blue Harbor FoodsA00007Paper A4 Box505001
41082026-10-152026-10-24C40000Blue Harbor FoodsA00005Toner Cartridge Black12602
41152026-10-212026-10-30C30000Northwind RetailA00012Wireless Keyboard252501

SQL Server vs SAP HANA

No functions change here; the HANA version differs only by double-quoted column names. The status filters 'O' are case-sensitive string literals in both databases, so keep them upper case.

Common errors and fixes

  • Lines already delivered still appear: Keep both T0.DocStatus = 'O' and T1.LineStatus = 'O'. A line closed manually has LineStatus 'C' even when the header is still open.
  • Dates per line differ from the header due date: DocDueDate is the header delivery date. If your team sets a delivery date per row, select T1.ShipDate and sort by it instead.

Need this report built into SAP Business One?

A saved query answers the question once. We build B2B customer portals for SAP Business One: customers see their prices, stock, order status, invoices and statements, and their orders land in SAP as sales orders. Or hire a remote SAP Business One developer for the whole job, fixed price per phase.

Sales

Related queries

Table reference: ORDR table (Sales Order (header)) · RDR1 table (Sales Order (lines))

How it works

Three steps, no signup

1

Copy the right version

Use the SQL Server tab for MS SQL databases and the HANA tab for SAP B1 on HANA.

2

Open Query Generator

In SAP Business One go to Tools → Queries → Query Generator, paste and click Execute.

3

Save and share

Click Save, pick a category and give the query a name. Your team can run it from Query Manager.

FAQ

Questions about this tool

How do I run the open sales orders with open quantity 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 ORDR, RDR1 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.

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.