PDN1 table in SAP Business One (Goods Receipt PO (rows))
PDN1 is the SAP Business One table that stores the rows of a goods receipt PO: one row per item received, with quantity, price, warehouse, open quantity and the purchase order row it came from. It joins to the header OPDN on DocEntry; BaseType 22 means the row was copied from a purchase order.
PDN1 key fields
| Field | What it holds |
|---|---|
DocEntry | Header key. Joins to OPDN.DocEntry. |
LineNum | Row number. |
ItemCode | Item. Joins to OITM.ItemCode. |
Dscription | Item description. |
Quantity | Quantity received. |
OpenQty | Remaining open quantity (not yet copied to an invoice or return). |
Price / Currency | Price and price currency. |
LineTotal | Row total. |
WhsCode | Warehouse. Joins to OWHS.WhsCode. |
BaseType | Base document type: 22 = purchase order, 540000006 = purchase quotation, and others. |
BaseEntry / BaseLine | Base document key and row. |
TargetType / TrgetEntry | Target document (18 = A/P invoice, 21 = goods return) and its key. |
How PDN1 relates to other tables
PDN1 rows belong to one OPDN header (DocEntry). BaseType 22 with BaseEntry and BaseLine points to the purchase order row in OPOR; TargetType and TrgetEntry point forward to the A/P invoice (OPCH) or goods return.
Common joins
PDN1 T0 INNER JOIN OPDN T1 ON T1.DocEntry = T0.DocEntry (header)PDN1 T0 LEFT JOIN OPOR T2 ON T2.DocEntry = T0.BaseEntry AND T0.BaseType = 22 (purchase order)PDN1 T0 LEFT JOIN OPCH T3 ON T3.DocEntry = T0.TrgetEntry AND T0.TargetType = 18 (A/P invoice)
When you use the PDN1 table
Use PDN1 to compare received quantities with purchase orders, to list received rows not yet invoiced, and to read the last receipt price per item and vendor.
Example query: received rows not yet invoiced, with their purchase order
SQL Server
SELECT T1.DocNum AS GrpoNum, T1.DocDate, T1.CardCode, T0.ItemCode, T0.Quantity, T0.OpenQty, T0.Price, T2.DocNum AS PoNum FROM PDN1 T0 INNER JOIN OPDN T1 ON T1.DocEntry = T0.DocEntry LEFT JOIN OPOR T2 ON T2.DocEntry = T0.BaseEntry AND T0.BaseType = 22 WHERE T0.OpenQty > 0 AND T1.CANCELED = 'N' ORDER BY T1.DocDate
SAP HANA (column names in double quotes)
SELECT T1."DocNum" AS "GrpoNum", T1."DocDate", T1."CardCode", T0."ItemCode", T0."Quantity", T0."OpenQty", T0."Price", T2."DocNum" AS "PoNum" FROM PDN1 T0 INNER JOIN OPDN T1 ON T1."DocEntry" = T0."DocEntry" LEFT JOIN OPOR T2 ON T2."DocEntry" = T0."BaseEntry" AND T0."BaseType" = 22 WHERE T0."OpenQty" > 0 AND T1."CANCELED" = 'N' ORDER BY T1."DocDate"
Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.
Common pitfall: BaseEntry without BaseType
A receipt row can be based on a purchase order, a purchase quotation or another document. BaseEntry alone is just a number, so always add BaseType = 22 when you join to OPOR. See OPOR table (purchase order).
Ready-made queries that use PDN1
- Last purchase price per item: The most recent A/P invoice price, vendor and date for every item.
- Open purchase orders by vendor: Open purchase order lines with quantity still to receive, grouped by vendor.
Questions about the PDN1 table
How do I link PDN1 to the purchase order?
PDN1.BaseType = 22, PDN1.BaseEntry = OPOR.DocEntry and PDN1.BaseLine = the PO row number.
What does OpenQty mean on PDN1?
The received quantity that has not yet been copied to a target document such as an A/P invoice or goods return.
How do I find the A/P invoice for a receipt row?
PDN1.TargetType = 18 and PDN1.TrgetEntry = OPCH.DocEntry.
Related tables
OPDN (Goods Receipt PO (header)) · OPOR (Purchase Order (header)) · OPCH (A/P Invoice (header)) · 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.
