OOCR table in SAP Business One (Distribution Rules (cost centers))
OOCR is the SAP Business One table of distribution rules, the cost accounting codes that split revenue and cost over cost centers: one row per rule with its code, name, total factor, dimension and active flag. Journal lines store the rule in JDT1.ProfitCode and OcrCode2 to OcrCode5, one column per dimension.
OOCR key fields
| Field | What it holds |
|---|---|
OcrCode | Distribution rule code, the key. JDT1.ProfitCode and INV1.OcrCode point to it. |
OcrName | Distribution rule description. |
DimCode | Dimension the rule belongs to (ODIM), 1 by default. |
OcrTotal | Total factor of the rule. |
Direct | Y = direct rule. |
IsFixedAmt | Y = distribute by fixed amount. |
Active | Y = active, N = inactive. |
Locked | Y = locked, N = not locked. |
AbsEntry | Internal numerator. |
UserSign2 / updateDate | User and date of the last update. |
How OOCR relates to other tables
OOCR is master data. Journal entry lines hold the rule of dimension 1 in JDT1.ProfitCode and the rules of dimensions 2 to 5 in OcrCode2 to OcrCode5. Document lines hold them in INV1.OcrCode and OcrCode2 to OcrCode5. OOCR.DimCode tells which dimension a rule belongs to.
Common joins
JDT1 T0 INNER JOIN OOCR T1 ON T1.OcrCode = T0.ProfitCode (dimension 1 rule of the journal line)JDT1 T0 LEFT JOIN OOCR T2 ON T2.OcrCode = T0.OcrCode2 (dimension 2 rule)INV1 T3 INNER JOIN OOCR T1 ON T1.OcrCode = T3.OcrCode (rule of the invoice line)
When you use the OOCR table
Use OOCR for profit and loss per cost center or department, to list the rules per dimension, and to find postings without a distribution rule on expense accounts.
Example query: balance per distribution rule (dimension 1) this year
SQL Server
SELECT T1.OcrCode, T1.OcrName, T1.DimCode, SUM(T0.Debit) AS Debit, SUM(T0.Credit) AS Credit, SUM(T0.Debit - T0.Credit) AS Balance FROM JDT1 T0 INNER JOIN OOCR T1 ON T1.OcrCode = T0.ProfitCode WHERE YEAR(T0.RefDate) = YEAR(GETDATE()) GROUP BY T1.OcrCode, T1.OcrName, T1.DimCode ORDER BY T1.OcrCode
SAP HANA (column names in double quotes)
SELECT T1."OcrCode", T1."OcrName", T1."DimCode", SUM(T0."Debit") AS "Debit", SUM(T0."Credit") AS "Credit", SUM(T0."Debit" - T0."Credit") AS "Balance" FROM JDT1 T0 INNER JOIN OOCR T1 ON T1."OcrCode" = T0."ProfitCode" WHERE YEAR(T0."RefDate") = YEAR(CURRENT_TIMESTAMP) GROUP BY T1."OcrCode", T1."OcrName", T1."DimCode" ORDER BY T1."OcrCode"
Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.
Common pitfall: Looking for a column named OcrCode in JDT1
On journal entry lines the dimension 1 rule is in JDT1.ProfitCode, not OcrCode; only dimensions 2 to 5 use OcrCode2 to OcrCode5. Document lines (INV1) do use OcrCode for dimension 1. Join each dimension column separately, or a multi-dimension report double-counts. See JDT1 table (journal entry lines).
Ready-made queries that use OOCR
- G/L account transactions: Journal lines for one G/L account in a period, with debit, credit and reference.
- G/L account balances: Current balance of every postable G/L account, grouped by account level.
Questions about the OOCR table
Which JDT1 column holds the distribution rule?
JDT1.ProfitCode for dimension 1 and OcrCode2 to OcrCode5 for dimensions 2 to 5. All join to OOCR.OcrCode.
What is DimCode in OOCR?
The dimension the rule belongs to; it defaults to 1.
Is a distribution rule the same as a cost center?
A distribution rule splits amounts over one or more cost centers; a rule with a single center is often used as the cost center code.
Related tables
JDT1 (Journal Entry Lines) · OJDT (Journal Entry (header)) · INV1 (A/R Invoice (lines)) · OPRJ (Project Codes) · 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.
