DLN1 table in SAP Business One (Delivery (rows))
DLN1 is the SAP Business One table that stores the rows of deliveries: one row per item shipped, with quantity, open quantity, price, warehouse and item cost. It joins to the header ODLN on DocEntry. BaseType 17 means the row came from a sales order, and TargetType 13 points to the A/R invoice.
What is the DLN1 table in SAP B1?
DLN1 is the SAP Business One table for delivery rows. Each row is one item shipped to a customer, with quantity, open quantity, price, warehouse and item cost, and joins to the ODLN header on DocEntry. BaseType 17 with BaseEntry and BaseLine points back to the sales order row; TargetType and TrgetEntry point to the invoice or return.
Where is the DLN1 table in SAP B1?
In SAP Business One 10.0, DLN1 is the "Delivery - Rows" table with 343 columns. You see its data in Sales - A/R → Delivery (header table ODLN).
| Table | DLN1 Delivery - Rows (child of ODLN) |
|---|---|
| Object type (ObjType) | 15 (oDeliveryNotes), the object type of ODLN |
| Menu path | Sales - A/R → Delivery |
| DI API object | Documents (oDeliveryNotes) |
| Service Layer entity | DeliveryNotes (request builder) |
| Columns | 343 in SAP B1 10.0 (SDK database tables reference) |
DLN1 key fields
| Field | SAP type | What it holds |
|---|---|---|
DocEntry | Int(11) | Header key. Joins to ODLN.DocEntry. |
LineNum | Int(11) | Row number inside the delivery. |
ItemCode | nVarChar(50) | Item delivered. Joins to OITM.ItemCode. |
Dscription | nVarChar(200) | Item description (SAP spelling). |
Quantity | Num(19,6) | Quantity delivered. |
OpenQty | Num(19,6) | Quantity not yet copied to an invoice or return. |
LineStatus | VarChar(1) | Row status: O = open, C = closed. |
Price / PriceBefDi | Num(19,6) | Price after the row discount / unit price before it. |
LineTotal | Num(19,6) | Row total before tax. |
WhsCode | nVarChar(8) | Warehouse the stock left. Joins to OWHS.WhsCode. |
StockPrice | Num(19,6) | Item cost of the row at the time of delivery. |
BaseType / BaseEntry / BaseLine | Int(11) | Base document: 17 = sales order, with its key and row. |
TargetType / TrgetEntry | Int(11) | Target document: 13 = A/R invoice, 16 = return, and its key. |
ShipDate | Date | Delivery date of the row. |
Types as listed in the SAP Business One 10.0 SDK database tables reference: nVarChar(n) is text of up to n characters, Num(19,6) a decimal with 6 places. Column names are the same on SQL Server and SAP HANA.
How DLN1 relates to other tables
DLN1 rows belong to one ODLN header (DocEntry). A row copied from a sales order stores BaseType 17, BaseEntry = ORDR.DocEntry and BaseLine = RDR1.LineNum. When the delivery is invoiced, the row keeps TargetType 13 and TrgetEntry = OINV.DocEntry, and the invoice row in INV1 stores BaseType 15 back to the delivery. A return stores BaseType 15 in RDN1.
Common joins
DLN1 T1 INNER JOIN ODLN T0 ON T0.DocEntry = T1.DocEntry (header)DLN1 T1 LEFT JOIN ORDR T2 ON T2.DocEntry = T1.BaseEntry AND T1.BaseType = 17 (sales order)DLN1 T1 LEFT JOIN OINV T3 ON T3.DocEntry = T1.TrgetEntry AND T1.TargetType = 13 (A/R invoice)DLN1 T1 LEFT JOIN OITM T4 ON T4.ItemCode = T1.ItemCode (item master)
When you use the DLN1 table
Use DLN1 for shipped quantities per item, warehouse or day, for the delivered-but-not-invoiced list at month end, and to trace a sales order row through delivery to invoice.
Example query: delivered rows not yet invoiced
SQL Server
SELECT T0.DocNum, T0.DocDate, T0.CardCode, T0.CardName, T1.ItemCode, T1.Quantity, T1.OpenQty, T1.LineTotal FROM ODLN T0 INNER JOIN DLN1 T1 ON T1.DocEntry = T0.DocEntry WHERE T0.CANCELED = 'N' AND T1.LineStatus = 'O' AND T1.OpenQty > 0 ORDER BY T0.DocDate, T0.DocNum, T1.LineNum
SAP HANA (column names in double quotes)
SELECT T0."DocNum", T0."DocDate", T0."CardCode", T0."CardName", T1."ItemCode", T1."Quantity", T1."OpenQty", T1."LineTotal" FROM ODLN T0 INNER JOIN DLN1 T1 ON T1."DocEntry" = T0."DocEntry" WHERE T0."CANCELED" = 'N' AND T1."LineStatus" = 'O' AND T1."OpenQty" > 0 ORDER BY T0."DocDate", T0."DocNum", T1."LineNum"
Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.
Common pitfall: Counting sales from DLN1 and INV1 together
A delivery that was copied to an A/R invoice exists in both DLN1 and INV1. Adding the two gives double sales. Take sales value from INV1 (minus credit memos in RIN1) and use DLN1 for shipped quantities and for what is delivered but not yet invoiced: LineStatus = 'O' with OpenQty above zero. See INV1 table (A/R invoice lines).
Ready-made queries that use DLN1
- Open sales orders with open quantity: Every open sales order line that still has quantity to deliver.
- Top 20 selling items: Best-selling items by sales value, with quantity sold, for a date range.
Building something on DLN1?
Reading DLN1 (Delivery (rows)) in a query is the easy part. 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 dedicated SAP B1 developer for the whole job, fixed price per phase.
Questions about the DLN1 table
What is the DLN1 table in SAP B1?
DLN1 is the SAP Business One table for delivery rows. Each row is one item shipped to a customer, with quantity, open quantity, price, warehouse and item cost, and joins to the ODLN header on DocEntry. BaseType 17 with BaseEntry and BaseLine points back to the sales order row; TargetType and TrgetEntry point to the invoice or return.
How do I link DLN1 to the sales order?
DLN1.BaseType = 17, DLN1.BaseEntry = ORDR.DocEntry and DLN1.BaseLine = RDR1.LineNum.
How do I find the A/R invoice for a delivery row?
DLN1.TargetType = 13 and DLN1.TrgetEntry = OINV.DocEntry. From the invoice side, INV1.BaseType = 15 and INV1.BaseEntry = ODLN.DocEntry.
What is the difference between ODLN and DLN1?
ODLN is the delivery header (customer, dates, totals, status), with one row per delivery. DLN1 holds the item rows. They join on DocEntry.
What does OpenQty mean on DLN1?
The delivered quantity that has not yet been copied to an A/R invoice or a return. Rows with LineStatus O and OpenQty above zero are delivered but not invoiced.
Related tables
ODLN (Delivery (header)) · RDR1 (Sales Order (lines)) · INV1 (A/R Invoice (lines)) · RDN1 (Returns (rows)) · search all SAP Business One tables
Sources: SAP Business One documentation and SDK (DI API database tables reference), SAP Help Portal; SDK 10.0 table page for DLN1.
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.
