OITM table in SAP Business One (Items (item master data))

OITM is the SAP Business One item master table: one row per item with its code, name, group, flags and the stock totals for all warehouses together. Stock per warehouse is in OITW and prices are in ITM1, both joined on ItemCode.

OITM key fields

FieldWhat it holds
ItemCodeItem key. Joins to OITW, ITM1 and every document line table.
ItemNameItem description.
ItmsGrpCodItem group. Joins to OITB.ItmsGrpCod.
OnHandStock in all warehouses together.
IsCommitedQuantity on open sales orders, all warehouses (spelled with one t).
OnOrderQuantity on open purchase orders, all warehouses.
AvgPriceItem cost used for stock valuation (moving average items).
InvntItemY if the item is an inventory item.
SellItemY if the item can be sold.
PrchseItemY if the item can be purchased.
MinLevelMinimum stock level set on the item.
CodeBarsBarcode of the item.

How OITM relates to other tables

OITM is master data, not a document, so it has no line table. Related tables use ItemCode as the foreign key: OITW holds one row per item and warehouse, ITM1 one row per item and price list, and OITB is the item group. Every document line table (RDR1, INV1, PCH1…) points back to OITM through ItemCode.

Common joins

  • OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode (stock per warehouse)
  • OITM T0 INNER JOIN ITM1 T2 ON T0.ItemCode = T2.ItemCode (prices, filter T2.PriceList)
  • OITM T0 INNER JOIN OITB T3 ON T0.ItmsGrpCod = T3.ItmsGrpCod (item group)

When you use the OITM table

OITM is the starting point for stock lists, price checks, reorder reports and item exports to e-commerce or a portal. Filter InvntItem = 'Y' when you only want stock items, and SellItem = 'Y' for items that appear on sales documents.

Example query: inventory items with stock and group

SQL Server

SELECT T0.ItemCode, T0.ItemName, T1.ItmsGrpNam, T0.OnHand, T0.IsCommited,
  T0.OnOrder, T0.OnHand - T0.IsCommited AS Available
FROM OITM T0
INNER JOIN OITB T1 ON T0.ItmsGrpCod = T1.ItmsGrpCod
WHERE T0.InvntItem = 'Y'
ORDER BY T0.ItemCode

SAP HANA (column names in double quotes)

SELECT T0."ItemCode", T0."ItemName", T1."ItmsGrpNam", T0."OnHand", T0."IsCommited",
  T0."OnOrder", T0."OnHand" - T0."IsCommited" AS "Available"
FROM OITM T0
INNER JOIN OITB T1 ON T0."ItmsGrpCod" = T1."ItmsGrpCod"
WHERE T0."InvntItem" = 'Y'
ORDER BY T0."ItemCode"

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

Common pitfall: OITM.OnHand is the total of every warehouse

OITM.OnHand adds up all warehouses, including ones you may not sell from (returns, transit, quality). For availability per warehouse, read OITW instead and filter the warehouses you need. See Stock by warehouse query.

Ready-made queries that use OITM

Related tables

OITW (Item stock per warehouse) · INV1 (A/R Invoice (lines)) · OCRD (Business Partners) · 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.