Start a project

G/L account balances

Current balance of every postable G/L account, grouped by account level.

Tables: OACTUse: Quick trial-balance view without running the full report.

Tool

SELECT T0.AcctCode, T0.AcctName, T0.GroupMask, T0.CurrTotal
FROM OACT T0
WHERE T0.Postable = 'Y' AND T0.CurrTotal <> 0
ORDER BY T0.AcctCode
Need your UDFs in this report, or a dashboard? We extend it for your company.Customize it →

What this query answers

Mid-month the controller wants a quick look at every account that carries a balance, without running the full trial balance with all its options. It is useful to spot a suspense or clearing account that should be zero.

Sample output

Illustrative demo values. Your columns are the same; the numbers come from your company.

AcctCodeAcctNameGroupMaskCurrTotal
111000Petty Cash12500
112100Bank - Main Account184320.5
211000Accounts Payable - Domestic2-36780
411000Sales Revenue - Domestic4-152400

SQL Server vs SAP HANA

There is nothing to translate except quoting: "AcctCode", "GroupMask", "CurrTotal" and "Postable" must keep their exact casing. The 'Y' literal is case-sensitive in both databases.

Common errors and fixes

  • Liability and revenue accounts show negative numbers: CurrTotal is debit minus credit, so credit-balance accounts are negative. Multiply by -1 for GroupMask 2, 3 and 4 if you want them shown as positive amounts.
  • Account codes look like _SYS00000000001: Your company uses account segmentation. Select T0.FormatCode for the code users see and order by it.

Need this report built into SAP Business One?

A saved query answers the question once. We build Crystal Reports and Power BI dashboards for SAP Business One on SQL Server and HANA, and you own the files. Or hire a remote SAP Business One developer for the whole job, fixed price per phase.

Finance

Related queries

Table reference: OACT table (G/L Accounts (chart of accounts)) · JDT1 table (Journal Entry Lines) · OJDT table (Journal Entry (header))

How it works

Three steps, no signup

1

Copy the right version

Use the SQL Server tab for MS SQL databases and the HANA tab for SAP B1 on HANA.

2

Open Query Generator

In SAP Business One go to Tools → Queries → Query Generator, paste and click Execute.

3

Save and share

Click Save, pick a category and give the query a name. Your team can run it from Query Manager.

FAQ

Questions about this tool

How do I run the g/l account balances query in SAP Business One?

Copy the version that matches your database, open Tools → Queries → Query Generator, paste it in the SQL box and click Execute. Save it to reuse it later.

Which tables does this query use?

It reads OACT from the standard SAP Business One schema. No user-defined fields are needed.

Can this be turned into a dashboard or alert?

Yes. We turn queries into Crystal reports, Excel reports that refresh themselves, SAP B1 alerts or WhatsApp messages for managers.

Need this inside SAP Business One?

We build add-ons, reports and integrations for SAP B1 on SQL Server and HANA. Tell us what you need and get a fixed price, usually within 24 hours.