SAP Business One Dunning Wizard - featured image of the automated collections tutorial

Publications

SAP Business One Dunning Wizard: Automate Collections and Control Overdue Debt with SQL

Hector Pincheira

Hector Pincheira

CIO | CTO
Digital Strategy & Technology Innovation

items

There is a scene that repeats at almost every company I have seen from the inside. The 25th rolls around, someone in finance opens a spreadsheet, filters the overdue invoices and starts calling. They call the customers they remember, the ones who complain loudest and the ones whose phone number is at hand. Meanwhile, an eight-million invoice from a small customer, ninety days overdue, ages in silence because nobody had time to look at it. The SAP Business One Dunning Wizard exists precisely so that collections stop depending on one person's memory.

The dunning wizard goes through your whole portfolio, identifies every overdue document, assigns it a severity level and generates the corresponding letters. It also updates the dunning level on each invoice, so next time the system knows exactly where the conversation with that customer left off. Sounds simple. In practice, most companies that have SAP Business One installed have never switched it on.

SAP Business One Dunning Wizard - overdue invoices piling up on the finance desk
The overdue portfolio keeps growing while everyone decides who calls first.

Why the SAP Business One Dunning Wizard stops being optional

The Chilean numbers help size up the problem. The Cómo Está la Cosa 2026, built on more than 1.35 million real invoices issued during 2025, shows that the average delay in business-to-business payment rose from 18.65 to 21.54 days in a single year. 58% of invoices are paid past the legal deadline and 95.7% of companies report having delinquent customers. If you still have no visibility into that receivables portfolio, the aging report is the natural starting point.

There is one figure in that same report that should change how you organize collections: the recovery rate falls from 66% to 26% between the first and the sixth month of delinquency. Put another way, collecting early is not an administrative virtue but a financial decision with measurable return. Every month an invoice goes unmanaged is money evaporating from your projected cash flow.

And here is the point that tends to be hard to land in management meetings. The collections problem is rarely a shortage of people. It is the lack of a process that runs the same way on the Monday of a long weekend as in the month the analyst is out on leave. Automating dunning therefore does not replace the collections team: it gives back the hours they spend today deciding who to call, so they can use them negotiating the hard cases.

The wizard also leaves a trail. Every letter sent is logged with its level and its date, so when the customer says they never received a notice, you have the history. That evidence works both for the commercial negotiation and to back up eventual legal collection.

Prerequisites before touching the wizard

Before opening the wizard, you need five things settled. None of them takes long, but skipping any one of them will force you to backtrack halfway through the process.

  • Authorization permissions about Sales – A/R > Dunning Wizard and about Administration > Setup > Business Partners > Dunning Terms.
  • Clean receivables. If you have paid invoices still sitting open because of missing internal reconciliation, the wizard will dun them anyway. This step is not negotiable.
  • G/L accounts defined for dunning fees and late interest, in case you decide to charge them.
  • Letter layouts ready. SAP Business One ships ten templates; the first three come predefined as first, second and third notice, and the remaining seven arrive blank.
  • Valid e-mail addresses in each customer's master data if you plan to send by e-mail instead of printing.

A warning with my name on it. The first time I ran this wizard in a production environment I sent more than a hundred third-level letters to customers who were perfectly current, because internal reconciliation had not been run in months and the system saw invoices as open that were already paid. The phone did not stop for two days and the sales manager still brings it up. Always run the wizard against a test database before touching production.

Step by step: configuring the dunning terms

The configuration lives in Administration > Setup > Business Partners > Dunning Terms. Here you define the rules of the game: how many notices, how far apart and at what cost.

  1. Create a dunning term and give it a code and a descriptive name. For example: STANDARD30 for customers with standard credit and KEY for strategic accounts that need more careful handling.
  2. Define the levels. You can use up to ten. For most companies, three or four are enough: a friendly notice 5 days past due, a formal reminder at 20, a credit suspension notice at 45 and handover to external collections at 75.
  3. Assign days from due date to each level. This value indicates how many days must pass after the due date for the document to qualify for that level.
  4. Configure the days between levels. This is the minimum time that must elapse since the last letter before the system escalates to the next level. Without this parameter, a customer could receive three letters in one week.
  5. Define interest and fees if your policy allows for them. SAP Business One automatically generates service invoices for these charges while the wizard runs.
  6. Select the letter layout for each level. Remember you need a different template for every level you define.
  7. First review the customer's payment terms and credit limit , because dunning on badly configured terms generates false positives. Then assign the term to each customer in the tab Payment terms tab of the business partner master data, field Dunning Term. Customers with the Block Dunning Letters box checked stay out of the process.

The mirror term trick

A detail you only learn by using it: it pays to create a dunning term called NO DUNNING with a single level at 999 days and assign it to the customers you do not want dunned automatically. It is cleaner than checking the block box, because afterwards you can list by SQL who is under that regime and why.

SAP Business One Dunning Wizard - reviewing receivables and defining dunning levels
Defining the levels is a commercial decision before it is a technical one.

Step by step: running the SAP Business One Dunning Wizard

The seven screens of the SAP Business One Dunning Wizard

The wizard opens from Sales – A/R > Dunning Wizard and moves through seven screens. Here is the full walkthrough.

  1. Welcome screen. Choose Start New Dunning Wizard Run o Load Saved Dunning Wizard Run if you left a run half finished.
  2. General parameters. Name the run, select the dunning term you are going to process and define the maximum level to apply. Use a name with the date, for example DUN-2026-09, because later you will need to identify it in the history.
  3. Business partner selection. Add customers by range, by group or by properties. The Clear Table button wipes the whole selection. The Include customers with zero or credit balance checkbox is useful for spotting open documents that offset each other.
  4. Document parameters. Define the posting and due date ranges, and mark which document types come in: invoices, credit memos, payments on account and manual journal entries with a customer line.
  5. Recommendation report. This is the screen that matters. SAP shows customer by customer which documents come in, at what level and for what amount. You can clear entire rows or change the proposed level before continuing.
  6. Processing. You choose between printing, sending by e-mail, saving the run to pick up later or simply generating the record without issuing letters.
  7. Closing. On completion, the system updates the dunning level and date on every document processed, and creates the entry in the history.

Spend real time on screen five. The wizard has no undo button: once you process, the levels are updated in the database and going back means fixing document by document. (Yes, in 2026.) That is why it pays to export the recommendation to Excel, review it with the sales team and only then process.

SQL queries to audit the SAP Business One Dunning Wizard

The wizard does the operational work. Management visibility, however, is still yours, and that is where SQL queries make the difference. The three queries below answer the questions a manager actually asks.

Query 1: overdue receivables and their real dunning level

Before running anything, it pays to know what is in the portfolio and how far it has been managed. There is a design detail that confuses a lot of people: the dunning level does not live in the invoice header but in the installments table INV6. As a result, an invoice with three due dates can carry three different levels at the same time, and anyone querying only OINV will see an incomplete picture.

SQL Server

-- Overdue receivables by installment, with dunning level reached
SELECT
    T1.CardCode,
    T1.CardName,
    ISNULL(T3.TermName, 'NO TERM') AS DunningTerm,
    T2.DocNum                            AS InvoiceNo,
    T0.InstlmntID                        AS InstallmentNo,
    T0.DueDate                           AS InstallmentDueDate,
    DATEDIFF(DAY, T0.DueDate, GETDATE()) AS DaysOverdue,
    T0.InsTotal - T0.PaidToDate          AS InstallmentBalance,
    T0.DunnLevel                         AS DunningLevelReached,
    CASE WHEN T0.DunWizBlck = 'Y' THEN 'BLOCKED' ELSE 'ACTIONABLE' END AS InstallmentStatus
FROM INV6 T0
    INNER JOIN OINV T2 ON T0.DocEntry = T2.DocEntry
    INNER JOIN OCRD T1 ON T2.CardCode = T1.CardCode
    LEFT  JOIN ODUT T3 ON T1.DunTerm  = T3.TermCode
WHERE T2.DocStatus = 'O'
  AND T0.DueDate < GETDATE()
  AND (T0.InsTotal - T0.PaidToDate) > 0
ORDER BY DaysOverdue DESC, InstallmentBalance DESC;

SAP HANA

-- Overdue receivables by installment, with dunning level reached
SELECT
    T1."CardCode",
    T1."CardName",
    IFNULL(T3."TermName", 'NO TERM') AS "DunningTerm",
    T2."DocNum"     AS "InvoiceNo",
    T0."InstlmntID" AS "InstallmentNo",
    T0."DueDate"    AS "InstallmentDueDate",
    DAYS_BETWEEN(T0."DueDate", CURRENT_DATE) AS "DaysOverdue",
    T0."InsTotal" - T0."PaidToDate"          AS "InstallmentBalance",
    T0."DunnLevel" AS "DunningLevelReached",
    CASE WHEN T0."DunWizBlck" = 'Y' THEN 'BLOCKED' ELSE 'ACTIONABLE' END AS "InstallmentStatus"
FROM INV6 T0
    INNER JOIN OINV T2 ON T0."DocEntry" = T2."DocEntry"
    INNER JOIN OCRD T1 ON T2."CardCode" = T1."CardCode"
    LEFT  JOIN ODUT T3 ON T1."DunTerm"  = T3."TermCode"
WHERE T2."DocStatus" = 'O'
  AND T0."DueDate" < CURRENT_DATE
  AND (T0."InsTotal" - T0."PaidToDate") > 0
ORDER BY "DaysOverdue" DESC, "InstallmentBalance" DESC;

Query 2: the gap between what is overdue and what is managed

This is the query worth taking to the management committee. It crosses the aging bucket against the dunning level reached and exposes the installments that have been more than thirty days overdue without a single letter sent. In my experience, that cell almost always surprises someone.

SQL Server

-- Management gap: aging bucket vs dunning level
SELECT
    CASE
        WHEN DATEDIFF(DAY, T0.DueDate, GETDATE()) <= 30  THEN '1. 01-30 days'
        WHEN DATEDIFF(DAY, T0.DueDate, GETDATE()) <= 60  THEN '2. 31-60 days'
        WHEN DATEDIFF(DAY, T0.DueDate, GETDATE()) <= 90  THEN '3. 61-90 days'
        ELSE '4. Over 90 days'
    END AS AgingBucket,
    COUNT(*)                                     AS OverdueInstallments,
    SUM(T0.InsTotal - T0.PaidToDate)             AS TotalBalance,
    SUM(CASE WHEN T0.DunnLevel = 0 THEN 1 ELSE 0 END)                        AS NotDunned,
    SUM(CASE WHEN T0.DunnLevel = 0 THEN T0.InsTotal - T0.PaidToDate ELSE 0 END) AS BalanceNotDunned,
    MAX(T0.DunnLevel)                            AS MaxLevelReached
FROM INV6 T0
    INNER JOIN OINV T2 ON T0.DocEntry = T2.DocEntry
    INNER JOIN OCRD T1 ON T2.CardCode = T1.CardCode
WHERE T2.DocStatus = 'O'
  AND T0.DueDate < GETDATE()
  AND (T0.InsTotal - T0.PaidToDate) > 0
GROUP BY
    CASE
        WHEN DATEDIFF(DAY, T0.DueDate, GETDATE()) <= 30  THEN '1. 01-30 days'
        WHEN DATEDIFF(DAY, T0.DueDate, GETDATE()) <= 60  THEN '2. 31-60 days'
        WHEN DATEDIFF(DAY, T0.DueDate, GETDATE()) <= 90  THEN '3. 61-90 days'
        ELSE '4. Over 90 days'
    END
ORDER BY AgingBucket;

SAP HANA

-- Management gap: aging bucket vs dunning level
SELECT
    CASE
        WHEN DAYS_BETWEEN(T0."DueDate", CURRENT_DATE) <= 30 THEN '1. 01-30 days'
        WHEN DAYS_BETWEEN(T0."DueDate", CURRENT_DATE) <= 60 THEN '2. 31-60 days'
        WHEN DAYS_BETWEEN(T0."DueDate", CURRENT_DATE) <= 90 THEN '3. 61-90 days'
        ELSE '4. Over 90 days'
    END AS "AgingBucket",
    COUNT(*) AS "OverdueInstallments",
    SUM(T0."InsTotal" - T0."PaidToDate") AS "TotalBalance",
    SUM(CASE WHEN T0."DunnLevel" = 0 THEN 1 ELSE 0 END) AS "NotDunned",
    SUM(CASE WHEN T0."DunnLevel" = 0 THEN T0."InsTotal" - T0."PaidToDate" ELSE 0 END) AS "BalanceNotDunned",
    MAX(T0."DunnLevel") AS "MaxLevelReached"
FROM INV6 T0
    INNER JOIN OINV T2 ON T0."DocEntry" = T2."DocEntry"
    INNER JOIN OCRD T1 ON T2."CardCode" = T1."CardCode"
WHERE T2."DocStatus" = 'O'
  AND T0."DueDate" < CURRENT_DATE
  AND (T0."InsTotal" - T0."PaidToDate") > 0
GROUP BY
    CASE
        WHEN DAYS_BETWEEN(T0."DueDate", CURRENT_DATE) <= 30 THEN '1. 01-30 days'
        WHEN DAYS_BETWEEN(T0."DueDate", CURRENT_DATE) <= 60 THEN '2. 31-60 days'
        WHEN DAYS_BETWEEN(T0."DueDate", CURRENT_DATE) <= 90 THEN '3. 61-90 days'
        ELSE '4. Over 90 days'
    END
ORDER BY "AgingBucket";

Query 3: the real effectiveness of each letter level

The business question is blunt: do the letters work? To answer it you have to look at the payments received and cross them against the dunning level each invoice carried. The RCT2 table stores how each payment is applied to its document, and type 13 corresponds to an A/R invoice.

SQL Server

-- Effectiveness: collections of the last 6 months by dunning level
SELECT
    T3.DunnLevel                    AS DunningLevelReached,
    COUNT(DISTINCT T2.DocEntry)     AS InvoicesCollected,
    SUM(T1.SumApplied)              AS AmountCollected,
    AVG(DATEDIFF(DAY, T2.DocDueDate, T0.DocDate) * 1.0) AS AvgDaysPastDue
FROM ORCT T0
    INNER JOIN RCT2 T1 ON T1.DocNum   = T0.DocEntry
    INNER JOIN OINV T2 ON T1.DocEntry = T2.DocEntry AND T1.InvType = 13
    INNER JOIN INV6 T3 ON T3.DocEntry = T2.DocEntry AND T3.InstlmntID = 1
WHERE T0.Canceled = 'N'
  AND T0.DocDate >= DATEADD(MONTH, -6, GETDATE())
  AND T2.DocDueDate < T0.DocDate
GROUP BY T3.DunnLevel
ORDER BY T3.DunnLevel;

SAP HANA

-- Effectiveness: collections of the last 6 months by dunning level
SELECT
    T3."DunnLevel" AS "DunningLevelReached",
    COUNT(DISTINCT T2."DocEntry") AS "InvoicesCollected",
    SUM(T1."SumApplied") AS "AmountCollected",
    AVG(DAYS_BETWEEN(T2."DocDueDate", T0."DocDate") * 1.0) AS "AvgDaysPastDue"
FROM ORCT T0
    INNER JOIN RCT2 T1 ON T1."DocNum"   = T0."DocEntry"
    INNER JOIN OINV T2 ON T1."DocEntry" = T2."DocEntry" AND T1."InvType" = 13
    INNER JOIN INV6 T3 ON T3."DocEntry" = T2."DocEntry" AND T3."InstlmntID" = 1
WHERE T0."Canceled" = 'N'
  AND T0."DocDate" >= ADD_MONTHS(CURRENT_DATE, -6)
  AND T2."DocDueDate" < T0."DocDate"
GROUP BY T3."DunnLevel"
ORDER BY T3."DunnLevel";

If level 3 accounts for the same amount collected as level 1, your escalation is not adding pressure: it is adding paperwork. In that case it pays to review the wording of the letters before adding more levels.

SAP Business One Dunning Wizard - collections team working with receivables data
With the portfolio measured, the team discusses cases instead of discussing figures.

Variations and use cases

The standard setup covers the classic scenario, though the wizard has more range than it appears. These are four variants I have seen work well.

  • Terms differentiated by segment. A high-volume retail customer and a distributor on an annual contract do not tolerate the same tone. Create one term per segment and assign it in bulk by business partner group.
  • Preventive notice before the due date. Define the first level with negative days, that is, ahead of the due date. According to the report cited earlier, that early intervention is the one with the lowest cost and the greatest impact on recovery.
  • Dunning with late interest. If your contract allows it, configure the rate in the term and let the system generate the service invoice. Careful, discuss this with the sales team before switching it on, because it is the kind of surprise that leaves a customer paying for an argument they did not expect.
  • Scheduled monthly run. Save the run under a stable name and run it on the same day every month. Consistency matters more than how sophisticated the wording is.

Best practices and common mistakes with the SAP Business One Dunning Wizard

The mistakes come first, because they are more useful.

  • Running without prior internal reconciliation. I already told you how that went for me. Reconcile, then dun.
  • Defining ten levels because the system allows it. Ten levels mean ten layouts to maintain and nobody maintains them. Three or four work better.
  • Forgetting the days between levels. Without that parameter the escalation runs away and the customer gets notices in cascade.
  • Processing without reviewing the recommendation. Screen five exists for a reason.
  • Not reviewing the wording of the letters. The templates come with a generic tone that sometimes clashes with the real commercial relationship.

As for good practices, three things make the difference. First, always run the wizard from the same user and at a fixed time, so the history is comparable month to month. Second, export the recommendation report and share it with the sales team before processing, because they usually have context the system does not see, such as a credit memo in progress or an open negotiation. Third, measure. If you do not measure effectiveness by level, you are automating a hunch.

One last note on versions. The dunning date field appears on the accounting tab of the invoice, and if memory serves, on older installations it was considerably harder to find. It is worth confirming the exact location in your version before writing up instructions for the team.

Official SAP Resources

Conclusion: collections stop depending on who remembers

Getting the SAP Business One Dunning Wizard running is not a project. It is one afternoon of configuration, one conversation with the sales team and a twenty-minute monthly routine. In exchange you get something no spreadsheet delivers: a process that runs the same way every month, an auditable history of every notice sent and three queries that tell you whether that work is producing results or just producing paper.

Start with Query 2. Look at how much money you have more than sixty days overdue with a dunning level of zero. In most of the companies I have reviewed, that number is enough to justify the whole setup in the first meeting. Then configure three levels, run them for a month and compare.

If this guide was useful, in the Círculo Estratégico I publish tutorials like this every week, with the queries ready to copy and paste. Write to me and let's talk about how your receivables look today.

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