OWHS table in SAP Business One (Warehouses)
OWHS is the SAP Business One warehouse master table: one row per warehouse with its code, name, flags, address, branch and G/L accounts. Its key is WhsCode, which OITW and every document line table use to say where stock sits.
OWHS key fields
| Field | What it holds |
|---|---|
WhsCode | Warehouse code, the primary key. Joins to OITW.WhsCode and the WhsCode of document lines. |
WhsName | Warehouse name. |
Locked | Y = locked, N = changeable. |
Inactive | Y if the warehouse is inactive. |
Nettable | Y (default) or N. MRP only counts stock in nettable warehouses. |
DropShip | Y for a drop-ship warehouse. |
BinActivat | Y if bin locations are active in this warehouse. |
DftBinAbs | Default bin. Joins to OBIN.AbsEntry. |
BPLid | Branch (business place). Joins to OBPL when branches are used. |
BalInvntAc | Inventory G/L account when accounts are set per warehouse. Joins to OACT. |
City / Country | Warehouse address fields. |
How OWHS relates to other tables
OWHS is master data, so it has no line table. OITW holds one row per item and warehouse, and document lines (RDR1, DLN1, INV1, PCH1 and others) store WhsCode to point back here. With bin locations active (BinActivat = Y), the bins of the warehouse are in OBIN and the quantity per bin in OIBQ.
Common joins
OWHS T0 INNER JOIN OITW T1 ON T0.WhsCode = T1.WhsCode (stock per item)OWHS T0 LEFT JOIN OBPL T2 ON T0.BPLid = T2.BPLId (branch)OWHS T0 LEFT JOIN OBIN T3 ON T0.DftBinAbs = T3.AbsEntry (default bin)
When you use the OWHS table
Use OWHS for warehouse names in stock reports, to filter out warehouses you do not sell or plan from, and to check setup such as branch, bins and G/L accounts before a go-live or migration.
Example query: warehouses with the number of items in stock
SQL Server
SELECT T0.WhsCode, T0.WhsName, T0.Nettable, T0.Inactive, T0.BinActivat, COUNT(T1.ItemCode) AS ItemsInStock FROM OWHS T0 LEFT JOIN OITW T1 ON T0.WhsCode = T1.WhsCode AND T1.OnHand > 0 GROUP BY T0.WhsCode, T0.WhsName, T0.Nettable, T0.Inactive, T0.BinActivat ORDER BY T0.WhsCode
SAP HANA (column names in double quotes)
SELECT T0."WhsCode", T0."WhsName", T0."Nettable", T0."Inactive", T0."BinActivat", COUNT(T1."ItemCode") AS "ItemsInStock" FROM OWHS T0 LEFT JOIN OITW T1 ON T0."WhsCode" = T1."WhsCode" AND T1."OnHand" > 0 GROUP BY T0."WhsCode", T0."WhsName", T0."Nettable", T0."Inactive", T0."BinActivat" ORDER BY T0."WhsCode"
Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.
Common pitfall: Available stock that includes the wrong warehouses
A stock list over all OITW rows also counts returns, quality, transit and drop-ship warehouses. Join OWHS and filter what your users really sell from, for example Inactive = 'N' and DropShip = 'N', and Nettable = 'Y' if the list should match what MRP counts. See Stock by warehouse query with variations.
Ready-made queries that use OWHS
- Stock by warehouse: On hand, committed, ordered and available quantity per item and warehouse.
- Inventory value by warehouse: Stock quantity multiplied by the item average cost, totalled per warehouse.
Related tables
OITW (Item stock per warehouse) · OITM (Items (item master data)) · OINM (Warehouse Journal (inventory audit)) · 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.
