RDR1 table in SAP Business One (Sales Order (lines))
RDR1 is the SAP Business One table that stores the lines of sales orders: item, quantity, open quantity, price, warehouse and delivery date per row. It joins to the ORDR header on DocEntry, and OpenQty with LineStatus tells you what is still to deliver.
RDR1 key fields
| Field | What it holds |
|---|---|
DocEntry | Key of the sales order. Joins to ORDR.DocEntry. |
LineNum | Row number inside the order. DocEntry + LineNum identifies a line. |
ItemCode | Item ordered. Joins to OITM.ItemCode. |
Dscription | Item or service description (SAP spelling). |
Quantity | Quantity ordered on the row. |
OpenQty | Remaining open quantity: what is not yet delivered or invoiced. |
DelivrdQty | Quantity already delivered. |
LineStatus | Row status: O = open, C = closed. |
Price / PriceBefDi | Price after the row discount / unit price before it. |
LineTotal | Row total, before tax and before the header discount on ORDR.DiscPrcnt. |
WhsCode | Warehouse the stock is committed in. Joins to OWHS.WhsCode. |
ShipDate | Delivery date of the row. |
TargetType / TrgetEntry | Target document the row was copied to, for example 15 = delivery (ODLN), 13 = A/R invoice. |
How RDR1 relates to other tables
RDR1 is the line table of ORDR. Each order has one ORDR row and one RDR1 row per item or service, sharing DocEntry. When a delivery or invoice is copied from the order, the target lines (DLN1, INV1) store BaseType = 17, BaseEntry = RDR1.DocEntry and BaseLine = RDR1.LineNum, and the order row keeps the target in TargetType and TrgetEntry.
Common joins
RDR1 T1 INNER JOIN ORDR T0 ON T1.DocEntry = T0.DocEntry (header)RDR1 T1 LEFT JOIN OITM T2 ON T1.ItemCode = T2.ItemCode (item master)RDR1 T1 LEFT JOIN OITW T3 ON T1.ItemCode = T3.ItemCode AND T1.WhsCode = T3.WhsCode (stock in the order warehouse)DLN1 T4 ON T4.BaseType = 17 AND T4.BaseEntry = T1.DocEntry AND T4.BaseLine = T1.LineNum (deliveries from the line)
When you use the RDR1 table
Use RDR1 for backorder and dispatch lists, open quantity per item or warehouse, and checks of committed stock against OITW. Customer, dates and cancel status are on ORDR, so almost every RDR1 query also joins the header.
Example query: open order quantity per item and warehouse
SQL Server
SELECT T1.ItemCode, T1.Dscription, T1.WhsCode, COUNT(DISTINCT T0.DocEntry) AS Orders, SUM(T1.OpenQty) AS OpenQty FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.CANCELED = 'N' AND T1.LineStatus = 'O' AND T1.OpenQty > 0 GROUP BY T1.ItemCode, T1.Dscription, T1.WhsCode ORDER BY OpenQty DESC
SAP HANA (column names in double quotes)
SELECT T1."ItemCode", T1."Dscription", T1."WhsCode", COUNT(DISTINCT T0."DocEntry") AS "Orders", SUM(T1."OpenQty") AS "OpenQty" FROM ORDR T0 INNER JOIN RDR1 T1 ON T0."DocEntry" = T1."DocEntry" WHERE T0."CANCELED" = 'N' AND T1."LineStatus" = 'O' AND T1."OpenQty" > 0 GROUP BY T1."ItemCode", T1."Dscription", T1."WhsCode" ORDER BY "OpenQty" DESC
Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.
Common pitfall: Quantity is not what is left to ship
Quantity is the ordered quantity and does not go down when part of the row is delivered. For backorders use OpenQty, and always combine it with LineStatus = 'O' so rows that were closed are left out. For values from the lines, remember that LineTotal is before the header discount on ORDR.DiscPrcnt. See Open sales orders query.
Ready-made queries that use RDR1
- Open sales orders with open quantity: Every open sales order line that still has quantity to deliver.
Related tables
ORDR (Sales Order (header)) · ODLN (Delivery (header)) · OITW (Item stock per warehouse) · OITM (Items (item master data)) · search all SAP Business One tables
Sources: SAP Business One documentation and SDK (DI API database tables reference), SAP Help Portal.
Ready to get started?
Tell us what you need. You get a clear technical answer, a fixed scope and a price, usually within 24 hours.
