SAP Business One Quotation Conversion: Measure Your Sales Funnel with SQL - tutorial featured image

Publications

SAP Business One Quotation Conversion: Measure Your Sales Funnel with SQL

Hector Pincheira

Hector Pincheira

CIO | CTO
Digital Strategy & Technology Innovation

items

Every month, your sales team issues dozens of quotes. Some turn into orders; most, however, get lost in a silent limbo. No one closes them, no one discards them, and no one measures them. When the management meeting comes around, the conversation always revolves around what was sold and almost never around what wasn't sold. In SAP Business One, quote conversion is precisely that blind indicator: the percentage of proposals that actually turn into sales orders. And it is, by far, the cheapest number to calculate and the most expensive to ignore.

The good news is that the ERP already stores all the evidence. Every time a user copies a quotation to an order, SAP records the link in the database. Therefore, you do not need an additional CRM or an extra license to measure your funnel: you need to know where to look. In this tutorial you will build, step by step, a set of SQL queries that answers four uncomfortable questions: how much we convert, who converts best, how long the cycle takes, and how much value is evaporating between the proposal and the order.

Why you need to measure your sales funnel conversion

Most management teams measure results rather than the process. As a result, they react too late. If your conversion rate drops from 38% to 24% in a quarter, the impact on revenue won’t be felt until two or three months later, by which time there’s no longer any room to maneuver. Conversion, on the other hand, is a leading indicator: it changes before sales do.

Furthermore, this analysis exposes three problems that no traditional sales report shows. First, it reveals the dead pipeline: open and expired quotes that keep inflating the forecast with no real chance of closing. Secondly, it exposes the value leakagethe client accepted, but bought fewer lines or a smaller quantity than what was offered. And thirdly, it measures the sales cycle, meaning how many days elapse between the proposal and the decision. That single piece of data reorganizes the conversation about sales team productivity.

SAP Business One quotation conversion - signing of an accepted commercial proposal
Every accepted quote leaves a trail in the database. The problem is that almost no one consults it.

Prerequisites before starting

To follow this tutorial you need three things. First, access to Query Manager from SAP Business One (Tools > Queries > Query Generator) or to an external tool such as SQL Server Management Studio or SAP HANA Studio with read permissions on the company database. Second, that your team effectively copy the quotation to the order from the ERP, instead of entering the order from scratch. Without that habit, the link does not exist and no query will be able to reconstruct it. Third, basic knowledge of Join and aggregation functions.

All queries in this article come in two versions: SQL Server and SAP HANA. This is how they work in any installation, regardless of the engine you have underneath.

Step 1: SAP Business One quotation conversion and the bridge almost no one checks

Here is the heart of the matter. When SAP copies a quotation to a sales order, it does not save the link in the order header: it saves it on each line. The table RDR1 (order lines) contains three key fields:

  • BaseType: the source object type. For sales quotation it applies 23.
  • BaseEntrythe DocEntry from the source quotation (OQUT).
  • Baselinethe Line number from the source quotation line (QUT1).

Therefore, building the correct bridge is the first step. Below is a reusable subquery that returns, for each converted quote, the date of the first generated order:

SQL Server

-- Quote to order bridge (reusable in all queries)
SELECT
    L.BaseEntry              AS QuotEntry,
    MIN(O.DocDate)           AS OrderDate,
    COUNT(DISTINCT O.DocEntry) AS GeneratedOrders
FROM RDR1 L
INNER JOIN ORDR O ON O.DocEntry = L.DocEntry
WHERE L.BaseType = 23
  AND O.CANCELED = 'N'
GROUP BY L.BaseEntry;

SAP HANA

-- Quote to order bridge (reusable in all queries)
SELECT
    L."BaseEntry"                 AS "QuotEntry",
    MIN(O."DocDate")              AS "FechaPedido",
    COUNT(DISTINCT O."DocEntry")  AS "PedidosGenerados"
FROM RDR1 L
INNER JOIN ORDR O ON O."DocEntry" = L."DocEntry"
WHERE L."BaseType" = 23
  AND O."CANCELED" = 'N'
GROUP BY L."BaseEntry";

Step 2: calculate the monthly conversion rate

With the bridge resolved, the overall rate comes out immediately. This query groups by month, counts issued quotes, counts how many resulted in orders, and calculates the percentage in both the number of documents and the amount:

SQL Server

SELECT
    YEAR(Q.DocDate)  AS Year,
    MONTH(Q.DocDate) AS Month,
    COUNT(*)         AS Quotations,
    SUM(CASE WHEN C.QuotEntry IS NOT NULL THEN 1 ELSE 0 END) AS Converted,
    CAST(100.00 * SUM(CASE WHEN C.QuotEntry IS NOT NULL THEN 1 ELSE 0 END)
         / COUNT(*) AS DECIMAL(10,2)) AS DocRatePct,
    CAST(SUM(Q.DocTotal) AS DECIMAL(18,2)) AS QuotedAmount,
    CAST(SUM(CASE WHEN C.QuotEntry IS NOT NULL THEN Q.DocTotal ELSE 0 END)
         AS DECIMAL(18,2)) AS ConvertedAmount
FROM OQUT Q
LEFT JOIN (
    SELECT L.BaseEntry AS QuotEntry
    FROM RDR1 L
    INNER JOIN ORDR O ON O.DocEntry = L.DocEntry
    WHERE L.BaseType = 23 AND O.CANCELED = 'N'
    GROUP BY L.BaseEntry
) C ON C.QuotEntry = Q.DocEntry
WHERE Q.CANCELED = 'N'
  AND Q.DocDate >= '20260101'
GROUP BY YEAR(Q.DocDate), MONTH(Q.DocDate)
ORDER BY 1, 2;

SAP HANA

SELECT
    YEAR(Q."DocDate")  AS "Year",
    MONTH(Q."DocDate") AS "Month",
    COUNT(*)           AS "Quotations",
    SUM(CASE WHEN C."QuotEntry" IS NOT NULL THEN 1 ELSE 0 END) AS "Converted",
    CAST(100.00 * SUM(CASE WHEN C."QuotEntry" IS NOT NULL THEN 1 ELSE 0 END)
         / COUNT(*) AS DECIMAL(10,2)) AS "DocRatePct",
    CAST(SUM(Q."DocTotal") AS DECIMAL(18,2)) AS "QuotedAmount",
    CAST(SUM(CASE WHEN C."QuotEntry" IS NOT NULL THEN Q."DocTotal" ELSE 0 END)
         AS DECIMAL(18,2)) AS "ConvertedAmount"
FROM OQUT Q
LEFT JOIN (
    SELECT L."BaseEntry" AS "QuotEntry"
    FROM RDR1 L
    INNER JOIN ORDR O ON O."DocEntry" = L."DocEntry"
    WHERE L."BaseType" = 23 AND O."CANCELED" = 'N'
    GROUP BY L."BaseEntry"
) C ON C."QuotEntry" = Q."DocEntry"
WHERE Q."CANCELED" = 'N'
  AND Q."DocDate" >= TO_DATE('2026-01-01')
GROUP BY YEAR(Q."DocDate"), MONTH(Q."DocDate")
ORDER BY 1, 2;

Pay attention to the difference between TasaDocsPct and the relationship between quoted and converted amounts. When the document-to-document rate is high but the amount-to-amount rate is low, your team is closing the easy deals and losing the big ones. That finding, by itself, justifies the entire exercise.

Step 3: measure performance and the sales cycle per salesperson

The company average hides huge differences among salespeople. Therefore, the next step consists of breaking down the rate by sales representative and adding a metric that almost no one calculates: the days that elapse between the issuance of the quote and the generation of the order.

SQL Server

SELECT
    ISNULL(S.SlpName, 'No salesperson') AS Salesperson,
    COUNT(*) AS Quotations,
    SUM(CASE WHEN C.QuotEntry IS NOT NULL THEN 1 ELSE 0 END) AS Converted,
    CAST(100.00 * SUM(CASE WHEN C.QuotEntry IS NOT NULL THEN 1 ELSE 0 END)
         / COUNT(*) AS DECIMAL(10,2)) AS RatePct,
    CAST(AVG(CASE WHEN C.FechaPedido IS NOT NULL
             THEN CAST(DATEDIFF(day, Q.DocDate, C.FechaPedido) AS DECIMAL(10,2))
             END) AS DECIMAL(10,1)) AS AvgCycleDays,
    CAST(SUM(Q.DocTotal) AS DECIMAL(18,2)) AS QuotedAmount
FROM OQUT Q
LEFT JOIN OSLP S ON S.SlpCode = Q.SlpCode
LEFT JOIN (
    SELECT L.BaseEntry AS QuotEntry, MIN(O.DocDate) AS FechaPedido
    FROM RDR1 L
    INNER JOIN ORDR O ON O.DocEntry = L.DocEntry
    WHERE L.BaseType = 23 AND O.CANCELED = 'N'
    GROUP BY L.BaseEntry
) C ON C.QuotEntry = Q.DocEntry
WHERE Q.CANCELED = 'N'
  AND Q.DocDate >= '20260101'
GROUP BY S.SlpName
HAVING COUNT(*) >= 5
ORDER BY RatePct DESC;

SAP HANA

SELECT
    IFNULL(S."SlpName", 'No salesperson') AS "Salesperson",
    COUNT(*) AS "Quotations",
    SUM(CASE WHEN C."QuotEntry" IS NOT NULL THEN 1 ELSE 0 END) AS "Converted",
    CAST(100.00 * SUM(CASE WHEN C."QuotEntry" IS NOT NULL THEN 1 ELSE 0 END)
         / COUNT(*) AS DECIMAL(10,2)) AS "PctRate",
    CAST(AVG(CASE WHEN C."FechaPedido" IS NOT NULL
             THEN CAST(DAYS_BETWEEN(Q."DocDate", C."FechaPedido") AS DECIMAL(10,2))
             END) AS DECIMAL(10,1)) AS "AvgCycleDays",
    CAST(SUM(Q."DocTotal") AS DECIMAL(18,2)) AS "QuotedAmount"
FROM OQUT Q
LEFT JOIN OSLP S ON S."SlpCode" = Q."SlpCode"
LEFT JOIN (
    SELECT L."BaseEntry" AS "QuotEntry", MIN(O."DocDate") AS "FechaPedido"
    FROM RDR1 L
    INNER JOIN ORDR O ON O."DocEntry" = L."DocEntry"
    WHERE L."BaseType" = 23 AND O."CANCELED" = 'N'
    GROUP BY L."BaseEntry"
) C ON C."QuotEntry" = Q."DocEntry"
WHERE Q."CANCELED" = 'N'
  AND Q."DocDate" >= TO_DATE('2026-01-01')
GROUP BY S."SlpName"
HAVING COUNT(*) >= 5
ORDER BY "PctRate" DESC;

The HAVING COUNT(*) >= 5 It prevents a salesperson with two quotes—both of which have been converted—from topping the rankings with an unrealistic 100% score. It’s a small detail, but it maintains the report’s credibility with the sales force.

SAP Business One quotation conversion - sales funnel analysis dashboard
The vendor fee and the sales cycle change the weekly meeting conversation.

Step 4: detect the dead pipeline

This is the query that usually generates the most discomfort and the most value. Return the quotes that are still open, have already passed their validity date, and never originated an order. In other words: inflated forecast.

SQL Server

SELECT
    Q.DocNum        AS Quotation,
    Q.CardCode,
    Q.CardName,
    Q.DocDate       AS IssueDate,
    Q.DocDueDate    AS ValidUntil,
    DATEDIFF(day, Q.DocDueDate, GETDATE()) AS DaysOverdue,
    CAST(Q.DocTotal AS DECIMAL(18,2))      AS Amount,
    ISNULL(S.SlpName, 'No salesperson')   AS Salesperson
FROM OQUT Q
LEFT JOIN OSLP S ON S.SlpCode = Q.SlpCode
WHERE Q.DocStatus = 'O'
  AND Q.CANCELED  = 'N'
  AND Q.DocDueDate < GETDATE()
  AND NOT EXISTS (
        SELECT 1 FROM RDR1 L
        WHERE L.BaseType = 23 AND L.BaseEntry = Q.DocEntry )
ORDER BY DaysOverdue DESC;

SAP HANA

SELECT
    Q."DocNum"      AS "Quotation",
    Q."CardCode",
    Q."CardName",
    Q."DocDate"     AS "IssueDate",
    Q."DocDueDate"  AS "ValidUntil",
    DAYS_BETWEEN(Q."DocDueDate", CURRENT_DATE) AS "DaysOverdue",
    CAST(Q."DocTotal" AS DECIMAL(18,2))        AS "Amount",
    IFNULL(S."SlpName", 'No sales person')     AS "SalesPerson"
FROM OQUT Q
LEFT JOIN OSLP S ON S."SlpCode" = Q."SlpCode"
WHERE Q."DocStatus" = 'O'
  AND Q."CANCELED"  = 'N'
  AND Q."DocDueDate" < CURRENT_DATE
  AND NOT EXISTS (
        SELECT 1 FROM RDR1 L
        WHERE L."BaseType" = 23 AND L."BaseEntry" = Q."DocEntry" )
ORDER BY "DaysOverdue" DESC;

Step 5: quantify the value leak line by line

A converted quote does not mean a fully sold quote. The customer may accept five out of eight lines, or reduce quantities. That is why header-level analysis is insufficient: you have to go down to the detail level. This query compares QUT1 against RDR1 using Baseline, with the previous aggregation that avoids duplicating rows when a quote line was copied to multiple orders.

SQL Server

SELECT
    Q.DocNum   AS Quote,
    Q.CardName AS Customer,
    CAST(SUM(L.LineTotal) AS DECIMAL(18,2))              AS QuotedAmount,
    CAST(SUM(ISNULL(R.LineTotal, 0)) AS DECIMAL(18,2))   AS OrderedAmount,
    CAST(SUM(L.LineTotal) - SUM(ISNULL(R.LineTotal, 0))
         AS DECIMAL(18,2))                               AS ValueLoss,
    CAST(100.00 * SUM(ISNULL(R.LineTotal, 0))
         / NULLIF(SUM(L.LineTotal), 0) AS DECIMAL(10,2)) AS PctCaptured
FROM OQUT Q
INNER JOIN QUT1 L ON L.DocEntry = Q.DocEntry
LEFT JOIN (
    SELECT R.BaseEntry, R.BaseLine, SUM(R.LineTotal) AS LineTotal
    FROM RDR1 R
    INNER JOIN ORDR O ON O.DocEntry = R.DocEntry
    WHERE R.BaseType = 23 AND O.CANCELED = 'N'
    GROUP BY R.BaseEntry, R.BaseLine
) R ON R.BaseEntry = L.DocEntry AND R.BaseLine = L.LineNum
WHERE Q.CANCELED = 'N'
  AND Q.DocDate >= '20260101'
GROUP BY Q.DocNum, Q.CardName
HAVING SUM(ISNULL(R.LineTotal, 0)) > 0
   AND SUM(L.LineTotal) - SUM(ISNULL(R.LineTotal, 0)) > 0
ORDER BY FugaValor DESC;

SAP HANA

SELECT
    Q."DocNum"   AS "Quote",
    Q."CardName" AS "Customer",
    CAST(SUM(L."LineTotal") AS DECIMAL(18,2))            AS "Quoted Amount",
    CAST(SUM(IFNULL(R."LineTotal", 0)) AS DECIMAL(18,2)) AS "Order Value",
    CAST(SUM(L."LineTotal") - SUM(IFNULL(R."LineTotal", 0))
         AS DECIMAL(18,2))                               AS "Value Loss",
    CAST(100.00 * SUM(IFNULL(R."LineTotal", 0))
         / NULLIF(SUM(L."LineTotal"), 0) AS DECIMAL(10,2)) AS "CapturedPercentage"
FROM OQUT Q
INNER JOIN QUT1 L ON L."DocEntry" = Q."DocEntry"
LEFT JOIN (
    SELECT R."BaseEntry" AS "BaseEntry", R."BaseLine" AS "BaseLine",
           SUM(R."LineTotal") AS "LineTotal"
    FROM RDR1 R
    INNER JOIN ORDR O ON O."DocEntry" = R."DocEntry"
    WHERE R."BaseType" = 23 AND O."CANCELED" = 'N'
    GROUP BY R."BaseEntry", R."BaseLine"
) R ON R."BaseEntry" = L."DocEntry" AND R."BaseLine" = L."LineNum"
WHERE Q."CANCELED" = 'N'
  AND Q."DocDate" >= TO_DATE('2026-01-01')
GROUP BY Q."DocNum", Q."CardName"
HAVING SUM(IFNULL(R."LineTotal", 0)) > 0
   AND SUM(L."LineTotal") - SUM(IFNULL(R."LineTotal", 0)) > 0
ORDER BY "ValueLoss" DESC;

The field Captured Pct This is the metric you should present to the sales committee. A 100% means you closed the entire deal. A 62% means that one-third of your pre-sales effort fell through, usually due to a lack of follow-up on the leads that were rejected.

Variations and real-world use cases

The previous five queries are the foundation. However, the real value appears when you adapt them to your specific business problem. These are the highest-performing variations in industrial and distribution companies:

  • Conversion by product line. add OITM and OITB in detail of QUT1 and group by article group. You will discover that certain families are priced high and sell little, which usually indicates a pricing issue rather than a sales effort problem.
  • Conversion by customer and by segment. group by Q.CardCode or incorporates it OCRG (business partner groups). This way you identify segments where you compete without winning.
  • Full funnel down to the invoice. Chain the same pattern forward: DLN1.BaseType = 17 links delivery with order, and INV1.BaseType = 15 Link invoice with delivery. This way you measure quotation, order, delivery, and invoice in a single view.
  • Opportunity layer. If your team uses the sales opportunities module, the table OOPR add the previous stage. Its fields Status (‘O’ open, ‘W’ won, ‘L’ lost), MaxSumLoc and Closing Date they allow measuring the funnel from the first contact.
  • Automatic alert. Turn the query from Step 4 into an SAP Business One alert that triggers every Monday with quotes about to expire. This is how you turn a report into a habit.
SAP Business One quotation conversion - sales pipeline review meeting
An indicator without a review ritual changes nothing. The consultation is the means; the weekly meeting is the end.

Best practices and common mistakes

Error 1: to confuse DocStatus = 'C' with «converted». It is the most frequent and most expensive error. A closed quote may have been closed manually by the user, without generating any order. Therefore, never use the status as a conversion proxy: always use the link. RDR1.BaseType = 23.

Error 2: ignore the field Canceled. Canceled documents are still physically in the table. If you don't filter them out, your denominator grows and your rate drops artificially.

Error 3: join QUT1 with RDR1 without adding first. When a quote line is partially copied to two different orders, the Join directly duplicates rows and the quoted value becomes inflated. The aggregated subquery from Step 5 solves exactly that problem.

Error 4: mixing coins. The field Document Total is expressed in local currency. If you operate in multiple currencies and need to consolidate, use DocTotalSy (system currency) for the comparison to be valid. Also, remember that Document Total includes taxes: if you want to analyze net value, subtract VatSum or works directly with Line Total at a detailed level.

Best practice: demand the habit before the report. No query works if salespeople enter orders from scratch. Consequently, before publishing the metric, validate what percentage of your orders originate from a quote. If it is low, the problem is not analytical: it is a process problem.

Best practice: save queries as views. Encapsulate the quote-to-order bridge in a database view and reuse it. This way you prevent each analyst from reinventing the Join and, above all, you prevent everyone from arriving at a different number for the same meeting.

Official SAP Resources

For further study, these are the resources you should keep on hand:

  • SAP Help Portal – SAP Business OneOfficial functional documentation for the sales module.
  • SAP Business One Database Tables Reference: the data dictionary with the definition of OQUT, QUT1, ORDER and RDR1, available on the SAP Help Portal.
  • SAP Communityforums where query patterns and version-specific features are discussed.
  • Administration guide for Query Manager within the product's online help, to publish your queries as user reports.

Conclusion: the data is already there, the decision is missing

Your ERP has spent years recording every proposal you made and every one that fell through. You don't need to buy anything new to know how much your sales force converts; you need five queries and the discipline to review them every week. That is the difference between having a system and using it.

Start simple. Execute Step 2 over the last twelve months and observe the trend. Then go down to Step 4 and add the amount of the dead pipeline: it is almost always a number that makes you uncomfortable enough to provoke action. Finally, take the Captured Pct Move from Step 5 to your commercial committee and watch how the conversation changes when lost margin stops being an intuition and becomes a figure.

If you found this guide helpful, Strategic Circle It is where I publish this type of material every week: applied SAP Business One tutorials, production-ready queries, and management analyses that you can implement the same day. Run the queries, share the results with your sales team, and let me know what you found.

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