Budget Management in SAP Business One: Setup and Control with SQL - featured image

Publications

Budget Management in SAP Business One: Configuration and Control with SQL

Hector Pincheira

Hector Pincheira

CIO | CTO
Digital Strategy & Technology Innovation

items

Half of the companies running an ERP approve spending without knowing how much budget they have left. Budgets in SAP Business One solve that problem at the root: the system checks every document against the annual plan and warns you, or blocks the transaction outright, before spending gets out of hand. Yet most implementations never turn this module on. Budget control ends up living in a spreadsheet nobody updates. In this tutorial you will learn how to set it up step by step and how to exploit it with SQL queries for SQL Server and SAP HANA.

Why do you need budget control inside the ERP?

A budget outside the system is a statement of intent. Inside the system it becomes a business rule. The difference is enormous: when the budget lives in SAP Business One, every purchase order, every supplier invoice and every journal entry is validated against the plan in real time. The variance is caught the moment the spend is committed, not three weeks later in the results meeting.

The budget module also requires no extra licenses or add-ons. You already paid for it with your SAP Business One license. Turning it on takes less than an hour and the payback is immediate: visibility, spending discipline and management conversations based on data rather than perceptions.

Budgets in SAP Business One - financial chart analysis and planning
Budget control inside the ERP turns the annual plan into an operating business rule.

Prerequisites

Before you start, check the following. First, you need a user with full authorization over Financials and over General Settings. Second, your chart of accounts must be clean: the budget is defined by G/L account, so a messy chart produces a messy budget. Finally, for the queries you need access to the Query Manager and you need to know whether your installation runs on Microsoft SQL Server or on SAP HANA, because the syntax differs.

How to define budgets in SAP Business One step by step

Step 1: enable the budget in General Settings

Go Administration > System Initialization > General Settings and open the Budgettab. Tick the budget initialization checkbox. The system then asks you for three key decisions that define how strict your control will be:

  • Action on deviation: block the deviation (the document is not saved), warning message (it warns but lets you continue) or no message (it only records).
  • Control basis: annual or monthly budget. Monthly control is more demanding, but also more realistic.
  • Documents to control: purchase orders, goods receipt POs and postings. Flagging purchase orders lets you control committed spend before it becomes actual spend.

A critical detail almost nobody reads in the documentation: the system only applies blocks and warnings against the main budget scenario. All other scenarios exist purely for simulation and reporting.

Step 2: define the budget scenario

Go to Financials > Budget Setup > Budget Scenarios. SAP Business One creates by default the Main Budget (Main Budget) scenario for each fiscal year, and that scenario cannot be deleted. You can, however, create additional scenarios: an optimistic one, a conservative one, a contingency one. To create them, select the fiscal year and add a new row. The system also lets you copy an existing scenario applying an adjustment percentage; for example, generating the conservative scenario as the main one minus 15%.

Step 3: configure the distribution methods

In Financials > Budget Setup > Budget Distribution Methods you define how the annual amount is spread across the twelve months. The system ships with three standard methods: equal (twelfths), ascending order and descending order. The most valuable option, though, is creating your own methods. A fruit company, for example, concentrates its operating spend between January and April; a seasonal distribution method reflects that reality and avoids false deviation alarms in peak season.

Step 4: load the amounts by account

Finally, open Financials > Budget Setup > Budget. Select the scenario, filter the expense or investment accounts you want to control and set the annual amount for each one. Then assign the distribution method and the system will calculate the monthly amounts automatically. You can also edit month by month when an account follows no pattern. Once confirmed, the budget is active and control starts working immediately.

Budgets in SAP Business One - expense control and variance charts
Comparing budget against actual by account reveals where the deviations are concentrated.

SQL queries to control the budget

The setup above turns on the control. Management, however, needs something more: visibility. The key tables are OBGS (scenarios), OBGD (distribution methods), OBGT (budget by account), BGT1 (monthly budget lines) and JDT1 (actual journal entries). With them we will build two essential reports.

Query 1: budget vs. actual by account

This query shows, for each budgeted account, the planned amount, the actual spend for the year, the available balance and the consumption percentage. The result is the report every finance manager asks for at month end, available in one click.

SQL Server

-- Budget vs Actual by account (SQL Server)
SELECT
    T0.AcctCode AS [Account],
    T3.AcctName AS [Name],
    SUM(T1.DebLTotal) AS [Budget],
    ISNULL(R.RealAmt, 0) AS [Actual],
    SUM(T1.DebLTotal) - ISNULL(R.RealAmt, 0) AS [Available],
    CASE WHEN SUM(T1.DebLTotal) = 0 THEN 0
         ELSE ROUND(ISNULL(R.RealAmt, 0) * 100.0 / SUM(T1.DebLTotal), 2)
    END AS [Pct_Used]
FROM OBGT T0
INNER JOIN BGT1 T1 ON T0.AbsId = T1.BudgId
INNER JOIN OBGS T2 ON T0.Instance = T2.AbsId
INNER JOIN OACT T3 ON T0.AcctCode = T3.AcctCode
LEFT JOIN (
    SELECT J.Account, SUM(J.Debit - J.Credit) AS RealAmt
    FROM JDT1 J
    WHERE YEAR(J.RefDate) = YEAR(GETDATE())
    GROUP BY J.Account
) R ON R.Account = T0.AcctCode
WHERE T2.Name = 'Presupuesto principal'
GROUP BY T0.AcctCode, T3.AcctName, R.RealAmt
ORDER BY [Pct_Used] DESC

SAP HANA

-- Budget vs Actual by account (SAP HANA)
SELECT
    T0."AcctCode" AS "Account",
    T3."AcctName" AS "Name",
    SUM(T1."DebLTotal") AS "Budget",
    IFNULL(R."RealAmt", 0) AS "Actual",
    SUM(T1."DebLTotal") - IFNULL(R."RealAmt", 0) AS "Available",
    CASE WHEN SUM(T1."DebLTotal") = 0 THEN 0
         ELSE ROUND(IFNULL(R."RealAmt", 0) * 100.0 / SUM(T1."DebLTotal"), 2)
    END AS "Pct_Used"
FROM OBGT T0
INNER JOIN BGT1 T1 ON T0."AbsId" = T1."BudgId"
INNER JOIN OBGS T2 ON T0."Instance" = T2."AbsId"
INNER JOIN OACT T3 ON T0."AcctCode" = T3."AcctCode"
LEFT JOIN (
    SELECT J."Account", SUM(J."Debit" - J."Credit") AS "RealAmt"
    FROM JDT1 J
    WHERE YEAR(J."RefDate") = YEAR(CURRENT_DATE)
    GROUP BY J."Account"
) R ON R."Account" = T0."AcctCode"
WHERE T2."Name" = 'Presupuesto principal'
GROUP BY T0."AcctCode", T3."AcctName", R."RealAmt"
ORDER BY "Pct_Used" DESC

Look at the consumption column: any account above 90% before the last quarter deserves a conversation. Very low consumption tells you something too: either you overestimated the budget or the related project is stalled.

Query 2: monthly budget variance

Annual control hides the problems until it is too late. This second query compares the distributed budget against actual spend on income statement accounts month by month, so you catch the trend before the year is consumed.

SQL Server

-- Monthly budget vs actual variance (SQL Server)
SELECT
    T1.Line_ID + 1 AS [Month],
    SUM(T1.DebLTotal) AS [Budget],
    ISNULL(R.RealMes, 0) AS [Actual],
    SUM(T1.DebLTotal) - ISNULL(R.RealMes, 0) AS [Variance]
FROM OBGT T0
INNER JOIN BGT1 T1 ON T0.AbsId = T1.BudgId
INNER JOIN OBGS T2 ON T0.Instance = T2.AbsId
LEFT JOIN (
    SELECT MONTH(J.RefDate) AS Mes,
           SUM(J.Debit - J.Credit) AS RealMes
    FROM JDT1 J
    INNER JOIN OACT A ON J.Account = A.AcctCode
    WHERE YEAR(J.RefDate) = YEAR(GETDATE())
      AND A.AcctCode LIKE '6%'  -- adjust to your expense account range
    GROUP BY MONTH(J.RefDate)
) R ON R.Mes = T1.Line_ID + 1
WHERE T2.Name = 'Presupuesto principal'
GROUP BY T1.Line_ID, R.RealMes
ORDER BY [Month]

SAP HANA

-- Monthly budget vs actual variance (SAP HANA)
SELECT
    T1."Line_ID" + 1 AS "Month",
    SUM(T1."DebLTotal") AS "Budget",
    IFNULL(R."RealMes", 0) AS "Actual",
    SUM(T1."DebLTotal") - IFNULL(R."RealMes", 0) AS "Variance"
FROM OBGT T0
INNER JOIN BGT1 T1 ON T0."AbsId" = T1."BudgId"
INNER JOIN OBGS T2 ON T0."Instance" = T2."AbsId"
LEFT JOIN (
    SELECT MONTH(J."RefDate") AS "Mes",
           SUM(J."Debit" - J."Credit") AS "RealMes"
    FROM JDT1 J
    INNER JOIN OACT A ON J."Account" = A."AcctCode"
    WHERE YEAR(J."RefDate") = YEAR(CURRENT_DATE)
      AND A."AcctCode" LIKE '6%'  -- adjust to your expense account range
    GROUP BY MONTH(J."RefDate")
) R ON R."Mes" = T1."Line_ID" + 1
WHERE T2."Name" = 'Presupuesto principal'
GROUP BY T1."Line_ID", R."RealMes"
ORDER BY "Month"

Adjust the account filter to your company chart of accounts. Also check the exact name of the main scenario in your database: depending on the localization it may appear as «Presupuesto principal» or «Main Budget».

Budgets in SAP Business One - monthly variance calculation with calculator and reports
Monthly tracking catches the spending trend before it eats the annual budget.

Variations and use cases

The module goes well beyond a spending traffic light. You can, for example, connect Query 1 to the SAP Business One alert system and receive every Monday the accounts consuming more than 90%. In the same way, additional scenarios let you simulate an optimistic plan and a contingency plan, and compare them against actual in the budget scenario report.

Another powerful use case: combining budget with cost centers. If you also distribute your expenses by dimension, you can build queries that cross budget variance by business area. The conversation stops being «we went over budget» and becomes «logistics went 8% over on extraordinary freight in March».

Best practices and common mistakes

First, the most important practice: socialize the block before you turn it on. If purchasing finds out overnight that its orders are being blocked, the module dies politically within a week. Start with warnings, measure for a quarter and only then enable the block.

Second, budget only the accounts you are actually going to manage. A budget over 400 accounts is as useless as no budget at all. And remember that control works only on the main scenario; the rest are simulation.

Third, do not confuse committed spend with actual spend. If you flagged purchase orders in the settings, the system takes the commitment into account, which is what you want, but your SQL reports on JDT1 only see what has been posted. Complement them with a query on POR1 (open purchase order lines) when you need the full picture.

Official SAP resources

To go deeper, check the official documentation: Budget scenarios, Budget distribution methods and General Settings: Budget tab on the SAP Help Portal.

Conclusion

Budgets in SAP Business One turn the annual plan into an operating control mechanism: every document is validated against the plan, every deviation is caught in time and every management conversation starts from data. Setup takes an hour; the discipline it creates lasts the whole year.

If this tutorial was useful to you, in the Circulo Estrategico you will find the full series of practical SAP Business One guides with queries ready to copy and paste. Turn it on this week: your month-end close will thank you.

Most Read

QlikSense Hierarchy: parent-child chart of accounts expanded by levels
QlikSense Hierarchy: the Chart of Accounts That Doesn't Add Up
QlikSense Sum TOTAL: share of each family over the total
QlikSense Sum TOTAL: the Percentage That Changes When You Filter
SAP Business One Inventory Revaluation - featured image of the tutorial
SAP Business One Inventory Revaluation: Fix Wrongly Loaded Costs
Empty chamber with wooden benches: the counterweight that required being present to be used
The Veto You Had to Say in Person: Your Decisions With No Counterweight
SAP Business One customizations - featured image of the pre-upgrade audit tutorial
SAP Business One Customizations: Pre-Upgrade Audit
SAP Business One Customer Concentration - featured image of the tutorial
SAP Business One Customer Concentration: Measure Your Risk with SQL

RELATED ARTICLES