OINM table in SAP Business One (Warehouse Journal (inventory audit))

OINM is the SAP Business One warehouse journal: one row per item movement, with the quantity received (InQty), the quantity issued (OutQty), the warehouse and the document that caused it (TransType and CreatedBy). Reports read it for item movement history; it must never be written to directly.

OINM key fields

FieldWhat it holds
TransNumJournal row number.
TransTypeType of the source document, for example 13 = A/R invoice, 15 = delivery, 59 = goods receipt, 60 = goods issue, 67 = inventory transfer.
CreatedByKey of the source document (its DocEntry for that TransType).
BASE_REFBase reference of the source document.
DocLineNumRow number in the source document.
DocDatePosting date of the movement.
ItemCodeItem. Joins to OITM.ItemCode.
InQtyQuantity received into the warehouse.
OutQtyQuantity issued from the warehouse.
WarehouseWarehouse of the movement. Joins to OWHS.WhsCode.

How OINM relates to other tables

OINM has no header or line split: each row is one movement of one item in one warehouse. TransType plus CreatedBy point back to the document, so TransType = 13 with CreatedBy = 25 is the A/R invoice with OINV.DocEntry = 25. An inventory transfer (67) writes a row out of the source warehouse and a row into the target. In the public SDK 10.0 database tables reference the warehouse journal is documented as OIVL (Whse Journal), with the same TransType, InQty and OutQty columns, so check which table your version exposes before you build a report on it.

Common joins

  • OINM T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode (item)
  • OINM T0 INNER JOIN OWHS T2 ON T0.Warehouse = T2.WhsCode (warehouse)
  • OINM T0 INNER JOIN OINV T3 ON T0.TransType = 13 AND T0.CreatedBy = T3.DocEntry (source A/R invoice)

When you use the OINM table

Use OINM for item movement history, stock on a past date as the sum of InQty - OutQty up to that date, and finding which document moved an item. For current stock, OITW is simpler and faster.

Example query: item movement per warehouse in a month

SQL Server

SELECT T0.ItemCode, T0.Warehouse, SUM(T0.InQty) AS QtyIn, SUM(T0.OutQty) AS QtyOut,
  SUM(T0.InQty - T0.OutQty) AS NetMovement
FROM OINM T0
WHERE T0.DocDate >= '20260101' AND T0.DocDate < '20260201'
GROUP BY T0.ItemCode, T0.Warehouse
ORDER BY T0.ItemCode, T0.Warehouse

SAP HANA (column names in double quotes)

SELECT T0."ItemCode", T0."Warehouse", SUM(T0."InQty") AS "QtyIn", SUM(T0."OutQty") AS "QtyOut",
  SUM(T0."InQty" - T0."OutQty") AS "NetMovement"
FROM OINM T0
WHERE T0."DocDate" >= '20260101' AND T0."DocDate" < '20260201'
GROUP BY T0."ItemCode", T0."Warehouse"
ORDER BY T0."ItemCode", T0."Warehouse"

Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.

Common pitfall: Never fix stock with an UPDATE on OINM

Changing OINM, OITW or OITM with SQL is not supported by SAP: the journal, stock per warehouse and the inventory G/L accounts stop matching. Correct stock with documents instead (goods receipt, goods issue or an inventory posting), and keep your own SQL on OINM read-only. See DI API error codes.

Related tables

OITM (Items (item master data)) · OITW (Item stock per warehouse) · OWHS (Warehouses) · 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.