INV1 table in SAP Business One (A/R Invoice (lines))

INV1 is the SAP Business One table that stores the lines of A/R invoices: item, quantity, price, line total and warehouse. It has no header data of its own, so you join it to OINV on DocEntry for dates, customer and status.

INV1 key fields

FieldWhat it holds
DocEntryKey of the invoice. Joins to OINV.DocEntry.
LineNumLine number inside the invoice, starting at 0.
ItemCodeItem sold. Joins to OITM.ItemCode. Empty on service invoices.
DscriptionLine description (spelled with one i and no e after the s).
QuantityQuantity in the sales unit.
PriceUnit price after the line discount.
PriceBefDiUnit price before the line discount.
LineTotalLine amount in local currency, before tax and before the header discount.
WhsCodeWarehouse the stock left from. Joins to OWHS.WhsCode.
SlpCodeSales employee on the line.
BaseType / BaseEntry / BaseLineSource document the line was copied from (for example 15 = delivery, 17 = sales order).

How INV1 relates to other tables

INV1 is the line table of OINV. Each row belongs to exactly one invoice through DocEntry, and DocEntry + LineNum is the unique key of a line. Dates, customer, cancel status and the header discount are on OINV, so almost every INV1 query also joins OINV.

Common joins

  • INV1 T1 INNER JOIN OINV T0 ON T1.DocEntry = T0.DocEntry (header)
  • INV1 T1 LEFT JOIN OITM T2 ON T1.ItemCode = T2.ItemCode (item master)
  • INV1 T1 LEFT JOIN OWHS T3 ON T1.WhsCode = T3.WhsCode (warehouse)

When you use the INV1 table

Use INV1 for anything per item: best sellers, slow movers, sales by item group or warehouse, and quantities sold in a period. For values, remember the header discount; for quantities, the lines are the right source.

Example query: quantity and net value sold per item

SQL Server

SELECT T1.ItemCode, T1.Dscription, SUM(T1.Quantity) AS QtySold,
  SUM(T1.LineTotal * (1 - T0.DiscPrcnt / 100.0)) AS NetValue
FROM OINV T0
INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.CANCELED = 'N' AND T0.DocDate >= '20260101'
GROUP BY T1.ItemCode, T1.Dscription
ORDER BY NetValue DESC

SAP HANA (column names in double quotes)

SELECT T1."ItemCode", T1."Dscription", SUM(T1."Quantity") AS "QtySold",
  SUM(T1."LineTotal" * (1 - T0."DiscPrcnt" / 100.0)) AS "NetValue"
FROM OINV T0
INNER JOIN INV1 T1 ON T0."DocEntry" = T1."DocEntry"
WHERE T0."CANCELED" = 'N' AND T0."DocDate" >= '20260101'
GROUP BY T1."ItemCode", T1."Dscription"
ORDER BY "NetValue" 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: Summing LineTotal overstates sales

LineTotal is before the header discount entered on OINV.DiscPrcnt. If your users give discounts on the header, SUM(LineTotal) is higher than the Sales Analysis report. Multiply by (1 - T0.DiscPrcnt / 100) as in the query above, and subtract A/R credit memo lines (RIN1) with the same factor. See Fix the header discount mismatch.

Ready-made queries that use INV1

Related tables

OINV (A/R Invoice (header)) · OITM (Items (item master data)) · OITW (Item stock per warehouse) · 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.