OPDN table in SAP Business One (Goods Receipt PO (header))
OPDN is the SAP Business One table that stores the header of every goods receipt PO, the purchasing document that records goods received from a vendor and adds them to stock. Its object type is 20. The rows are in PDN1, joined on DocEntry; they point back to the purchase order (BaseType 22).
OPDN key fields
| Field | What it holds |
|---|---|
DocEntry | Internal key. Joins to PDN1.DocEntry. |
DocNum | Document number users see. |
DocDate | Posting date. |
CardCode / CardName | Vendor. Joins to OCRD.CardCode. |
NumAtCard | Vendor reference number. |
DocStatus | O = open, C = closed. |
CANCELED | Y = cancelled, N = not cancelled, C = cancellation. |
DocTotal / DocCur | Document total and currency. |
VatSum | Total tax. |
TransId | Journal entry created by the receipt. Joins to OJDT.TransId. |
ObjType | Object type, 20 = goods receipt PO. |
How OPDN relates to other tables
OPDN is the header and PDN1 holds the rows. A row copied from a purchase order has PDN1.BaseType = 22 and BaseEntry = OPOR.DocEntry. When it is copied on, PDN1.TargetType is 18 (A/P invoice), 21 (goods return) or 204 (A/P down payment).
Common joins
OPDN T0 INNER JOIN PDN1 T1 ON T1.DocEntry = T0.DocEntry (rows)PDN1 T1 LEFT JOIN OPOR T2 ON T2.DocEntry = T1.BaseEntry AND T1.BaseType = 22 (purchase order)PDN1 T1 LEFT JOIN OPCH T3 ON T3.DocEntry = T1.TrgetEntry AND T1.TargetType = 18 (A/P invoice)OPDN T0 LEFT JOIN OJDT T4 ON T4.TransId = T0.TransId (journal entry)
When you use the OPDN table
Use OPDN to list goods received per vendor and period, to find receipts not yet invoiced (open GRPOs), and to check three-way matching between purchase order, receipt and A/P invoice.
Example query: open goods receipt pos (received, not fully invoiced)
SQL Server
SELECT T0.DocNum, T0.DocDate, T0.CardCode, T0.CardName, T0.NumAtCard, T0.DocTotal, DATEDIFF(day, T0.DocDate, GETDATE()) AS DaysOpen FROM OPDN T0 WHERE T0.DocStatus = 'O' AND T0.CANCELED = 'N' ORDER BY T0.DocDate
SAP HANA (column names in double quotes)
SELECT T0."DocNum", T0."DocDate", T0."CardCode", T0."CardName", T0."NumAtCard", T0."DocTotal", DAYS_BETWEEN(T0."DocDate", CURRENT_TIMESTAMP) AS "DaysOpen" FROM OPDN T0 WHERE T0."DocStatus" = 'O' AND T0."CANCELED" = 'N' ORDER BY T0."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: An open GRPO is not a missing delivery
DocStatus O on OPDN means rows are still open for a target document such as an A/P invoice or goods return, not that goods are missing. Look at PDN1.OpenQty and TargetType to see what is left to invoice, and filter CANCELED = 'N'. See Open purchase orders query.
Ready-made queries that use OPDN
- Open purchase orders by vendor: Open purchase order lines with quantity still to receive, grouped by vendor.
- Last purchase price per item: The most recent A/P invoice price, vendor and date for every item.
Questions about the OPDN table
What is the object type of a goods receipt PO in SAP B1?
20. It is the default of OPDN.ObjType and PDN1.ObjType.
How do I find the purchase order of a goods receipt PO?
PDN1.BaseType = 22 and PDN1.BaseEntry = OPOR.DocEntry.
What is the difference between OPDN and OIGN?
OPDN is the goods receipt PO from a vendor (20); OIGN is the inventory goods receipt without a vendor document (59).
Related tables
PDN1 (Goods Receipt PO (rows)) · 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.
