OACT table in SAP Business One (G/L Accounts (chart of accounts))

OACT is the SAP Business One table that stores the chart of accounts: one row per G/L account, both title accounts and postable (active) accounts, with the account hierarchy and the current balance. Journal lines in JDT1 point to it through JDT1.Account = OACT.AcctCode.

OACT key fields

FieldWhat it holds
AcctCodeInternal account key. JDT1.Account and the account fields on documents store this value.
AcctNameAccount name.
FormatCodeThe account number users see. With account segmentation it differs from AcctCode.
PostableY = active account you can post to, N = title account (a heading in the tree).
LevelsLevel in the account tree (1 = drawer such as Assets, higher numbers = deeper).
FatherNumAcctCode of the parent title account.
GroupMaskThe drawer the account belongs to (assets, liabilities, equity, revenue, expenses and so on, numbered per localization).
CurrTotalCurrent balance in local currency.
SysTotalCurrent balance in system currency.
FcTotalBalance in the account currency.
ActCurrAccount currency.
LocManTranY = control account (for example accounts receivable).
FrozenY = account on hold.

How OACT relates to other tables

OACT is master data. Every posting is in JDT1 (journal lines) with JDT1.Account = OACT.AcctCode, and the header is in OJDT. Business partner control accounts (OCRD.DebPayAcct) and the account fields on items, warehouses and tax codes also store AcctCode. The account tree is built from FatherNum and Levels.

Common joins

  • OACT T0 INNER JOIN JDT1 T1 ON T1.Account = T0.AcctCode (journal lines)
  • OACT T0 LEFT JOIN OACT T2 ON T2.AcctCode = T0.FatherNum (parent title account)
  • OCRD T3 INNER JOIN OACT T0 ON T0.AcctCode = T3.DebPayAcct (BP control account)

When you use the OACT table

Use OACT for a quick trial balance, an account list for the accountant, mapping accounts to a reporting structure, or to check that every account in a report is postable. For balances at a date or for a period, sum JDT1 instead of reading CurrTotal.

Example query: balance per postable account at a date (from jdt1)

SQL Server

SELECT T0.FormatCode, T0.AcctName,
  SUM(T1.Debit - T1.Credit) AS Balance
FROM OACT T0
INNER JOIN JDT1 T1 ON T1.Account = T0.AcctCode
WHERE T0.Postable = 'Y' AND T1.RefDate <= '[%0]'
GROUP BY T0.FormatCode, T0.AcctName
ORDER BY T0.FormatCode

SAP HANA (column names in double quotes)

SELECT T0."FormatCode", T0."AcctName",
  SUM(T1."Debit" - T1."Credit") AS "Balance"
FROM OACT T0
INNER JOIN JDT1 T1 ON T1."Account" = T0."AcctCode"
WHERE T0."Postable" = 'Y' AND T1."RefDate" <= '[%0]'
GROUP BY T0."FormatCode", T0."AcctName"
ORDER BY T0."FormatCode"

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

Common pitfall: FormatCode vs. AcctCode, and CurrTotal is today only

Users know accounts by the number on screen, which is FormatCode. JDT1.Account stores AcctCode, which with account segmentation is an internal code, so filtering JDT1.Account on the number users see can find nothing. Join to OACT and filter on FormatCode. CurrTotal is the balance right now; it ignores dates, so it cannot give you last month's balance. Sum JDT1 up to the date you need. See JDT1 table (journal lines).

Ready-made queries that use OACT

Related tables

JDT1 (Journal Entry Lines) · OJDT (Journal Entry (header)) · 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.