DRF1 table in SAP Business One (Draft Documents (rows))

DRF1 is the SAP Business One table that stores the rows of draft documents: one row per item or service on a draft, with quantity, price, warehouse and base document. It joins to the header ODRF on DocEntry; the document type of the draft is on the header (ODRF.ObjType).

DRF1 key fields

FieldWhat it holds
DocEntryHeader key. Joins to ODRF.DocEntry.
LineNumRow number.
ItemCodeItem. Joins to OITM.ItemCode.
DscriptionItem or service description.
QuantityQuantity.
Price / CurrencyPrice and price currency.
LineTotalRow total.
WhsCodeWarehouse. Joins to OWHS.WhsCode.
BaseTypeBase document type, for example 15 = delivery, 13 = A/R invoice, 20 = goods receipt PO.
BaseEntry / BaseLineBase document key and row.
ObjTypeObject type of the row, 112 (the draft object).

How DRF1 relates to other tables

DRF1 rows belong to one ODRF header (DocEntry). Unlike other row tables, DRF1.ObjType is the draft object (112) on every row, so the type of document the draft will become must be read from ODRF.ObjType.

Common joins

  • DRF1 T0 INNER JOIN ODRF T1 ON T1.DocEntry = T0.DocEntry (header)
  • DRF1 T0 INNER JOIN OITM T2 ON T2.ItemCode = T0.ItemCode (item master)

When you use the DRF1 table

Use DRF1 to see which items are on open drafts (for example draft deliveries waiting for approval), and to check quantities before a draft is posted.

Example query: items on open draft a/r invoices

SQL Server

SELECT T1.DocEntry AS DraftEntry, T1.CardCode, T0.ItemCode, T0.Quantity, T0.Price,
  T0.LineTotal, T1.WddStatus
FROM DRF1 T0
INNER JOIN ODRF T1 ON T1.DocEntry = T0.DocEntry
WHERE T1.ObjType = '13' AND T1.DocStatus = 'O'
ORDER BY T1.DocEntry, T0.LineNum

SAP HANA (column names in double quotes)

SELECT T1."DocEntry" AS "DraftEntry", T1."CardCode", T0."ItemCode", T0."Quantity", T0."Price",
  T0."LineTotal", T1."WddStatus"
FROM DRF1 T0
INNER JOIN ODRF T1 ON T1."DocEntry" = T0."DocEntry"
WHERE T1."ObjType" = '13' AND T1."DocStatus" = 'O'
ORDER BY T1."DocEntry", T0."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: Filtering the draft type on DRF1.ObjType

DRF1.ObjType defaults to 112 on every row, whatever the draft is for. Filter the document type on the header, ODRF.ObjType (for example '13' for A/R invoice drafts). See ODRF table (drafts).

Ready-made queries that use DRF1

Questions about the DRF1 table

How do I know which document type a DRF1 row belongs to?

Join ODRF on DocEntry and read ODRF.ObjType; DRF1.ObjType is 112 for every draft row.

Are draft rows in the same table for all documents?

Yes. DRF1 holds the rows of drafts of every document type.

How do I join DRF1 to its header?

On DRF1.DocEntry = ODRF.DocEntry.

Related tables

ODRF (Draft Documents (header)) · INV1 (A/R Invoice (lines)) · RDR1 (Sales Order (lines)) · 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.