In industrial, food, pharmaceutical, or manufacturing companies, the SAP Business One batch management It is not an option: it is an operational necessity and, in many cases, a regulatory requirement. However, in practice, many organizations that already work with SAP Business One have this module half-activated or, even worse, completely deactivated. As a result, when a quality issue or product recall arises, no one can respond with precision: Which batch was shipped, when, and to whom?
In this article, you will learn how to properly configure and use batch and serial number management in SAP Business One, from initial activation to the SQL queries that will give you total traceability of your inventory. Likewise, we will include query versions for SQL Server and SAP HANA.



Why batch traceability is critical for your operation
Consider this real-world scenario: your company distributes supplies and a customer reports a product issue. Without active batch management, your team would have to review dozens of invoices manually to determine what was shipped and which inventory receipt that item came from. Consequently, you waste valuable hours on a crisis process that should be resolved in minutes.
Therefore, activating batch and serial number management in SAP Business One provides you with concrete and measurable benefits:
- Full traceabilityFrom the purchase or production order to the final customer invoice.
- Expiration trackingAutomatic alerts for products nearing expiration, preventing invalid shipments.
- Precise market recallIdentify in seconds which customers received a specific batch.
- Regulatory complianceMandatory requirement in industries such as food, pharmaceutical, and medical devices.
- Simplified auditsTraceability reports ready to submit to regulatory bodies.
Furthermore, when you combine batches with serial numbers, you can individually track each unit. This is essential for industrial equipment, high-value electronics, or any product that requires a service and warranty history.
Prerequisites before starting
Before activating batch management, verify that these conditions are met in your SAP Business One system:
- Administrator access to modify article settings.
- The items you will manage by batch must not have ongoing movements without an assigned batch (this can cause balance inconsistencies).
- Define the inventory valuation method (FIFO or Moving Average) before activating lots, as changing it afterward is complex.
- In SAP HANA, verify that the system is at version 9.3 or higher to access the full traceability functionality.
However, if you already have items with inventory balances and want to activate batch management, SAP Business One will allow you to do so. However, you will need to perform an initial inventory adjustment to assign the corresponding batch to the current stock before continuing to operate.
Step 1: Activate batch management by item
The SAP Business One batch management it is activated article by article, not globally. First, open the item card from Inventory → Item Master and select the item you want to configure.
Next, go to the tab Inventory Data. There you will find the field Management Method, which is set to «None» by default. To enable batches, change it to «Batch». If, on the other hand, you need individual follow-up, choose «By Serial Number».
Once the change is saved, SAP Business One will require that every incoming or outgoing transaction for that item includes the corresponding batch number. This way, no movement can be made without identifying the batch, which guarantees traceability from the first document.
Additionally, in the same tab you can configure the following expiration control parameters:
- Shelf life in daysSAP will automatically calculate the due date upon entering the manufacturing date.
- Pre-expiration warningNumber of days prior to the due date that the system will alert the user.
- Expired lot restrictionYou can block the dispatch of batches whose expiration date has already passed.
Step 2: Register batches in receiving documents
Once the management method is activated, the next step consists of registering the lots upon receiving merchandise. When you enter a Goods Receipt or you process a Purchase order For a batch-managed item, SAP Business One will automatically display a window to record the batch details.
In that window, you must complete at least the following fields:
- Batch numberThe unique identifier of the batch (it can be the supplier code or one generated internally).
- QuantityThe units assigned to that specific batch.
- Manufacturing and expiration date: If applicable depending on the industry or product type.
For example, if you receive 500 units of a raw material in 3 different batches from the supplier, you can record the 3 batches in a single receipt, assigning the corresponding quantity to each one. Consequently, SAP Business One will track the stock differentiated by batch from that moment on, enabling fine-grained inventory control.



Step 3: Select batches in issues and sales
In the same way that batches are recorded in goods receipts, SAP Business One requests selecting the batch in each outgoing document: Deliveries, Sales Invoices, Warehouse Transfers, and Inventory Issues.
When adding a line with a batch-managed item, the system displays a batch icon in the row. Upon clicking, SAP displays all available batches with their quantity, manufacturing date, and expiration date. Thus, you can manually select the batch or configure the system to assign it automatically based on FIFO (First In, First Out).
However, there is a very common mistake in this step: letting the user select the batch arbitrarily, without following any defined policy. Therefore, it is essential to establish a batch outflow policy in your company (FIFO or FEFO — first expired, first out) and formally communicate it to the operational team.
SQL queries for batch management in SAP Business One
Once you have batch management active, SQL queries allow you to extract information that standard SAP screens do not always present efficiently. Below, you will find two essential queries for daily operations, with versions for SQL Server and SAP HANA.
Batch inventory with expiration status
This query shows all lots in stock, with their quantity, dates, and a calculated status (Valid, Expiring Soon, or Expired). It is ideal to run it daily as part of inventory control. The main table is ITTO (Batch Numbers), which stores the current balance per batch.
SQL Server
SELECT
T0.[DistNumber] AS 'Batch Number',
T0.[ItemCode] AS 'Item Code',
T1.[ItemName] AS 'Description',
T0.[WhsCode] AS 'Warehouse',
T0.[Quantity] AS 'Quantity',
T0.[MfgDate] AS 'Manufacturing Date',
T0.[ExpDate] AS 'Expiration Date',
DATEDIFF(DAY, GETDATE(), T0.[ExpDate]) AS 'Days to Expire',
CASE
WHEN T0.[ExpDate] IS NULL THEN 'No Expiration'
WHEN DATEDIFF(DAY, GETDATE(), T0.[ExpDate]) < 0 THEN 'EXPIRED'
WHEN DATEDIFF(DAY, GETDATE(), T0.[ExpDate]) 0
ORDER BY
CASE WHEN T0.[ExpDate] IS NULL THEN 2 ELSE 1 END,
T0.[ExpDate] ASC
SAP HANA
SELECT
T0."DistNumber" AS "Batch Number",
T0."ItemCode" AS "Item Code",
T1."ItemName" AS "Description",
T0."WhsCode" AS "Warehouse",
T0."Quantity" AS "Quantity",
T0."MfgDate" AS "Manufacturing Date",
T0."ExpDate" AS "Expiration Date",
DAYS_BETWEEN(CURRENT_DATE, T0."ExpDate") AS "Days to Expire",
CASE
WHEN T0."ExpDate" IS NULL THEN 'No Expiration'
WHEN DAYS_BETWEEN(CURRENT_DATE, T0."ExpDate") < 0 THEN 'EXPIRED'
WHEN DAYS_BETWEEN(CURRENT_DATE, T0."ExpDate") 0
ORDER BY
CASE WHEN T0."ExpDate" IS NULL THEN 2 ELSE 1 END ASC,
T0."ExpDate" ASC
In this query, the field Expiration Date corresponds to the batch expiration date. The calculated column State Automatically classify each batch into three categories. This way, you can run this query in the SAP Query Manager and schedule it as a daily alert for the warehouse team.
Query 2: Complete traceability of a batch's movements
This second query is the one you will use in critical situations: when you need to know exactly which documents involve a specific lot, for example for a product recall or a quality investigation. The table IBT1 stores all lot movements (inbound and outbound) with reference to the source document.
SQL Server
SELECT
T0.[DistNumber] AS 'Batch Number',
T0.[ItemCode] AS 'Item Code',
T1.[ItemName] AS 'Item Name',
CASE T0.[Direction]
WHEN 0 THEN 'Inbound'
WHEN 1 THEN 'Outbound'
END AS 'Movement Type',
T0.[Quantity] AS 'Quantity',
T0.[DocDate] AS 'Document Date',
T0.[BaseType] AS 'Base Doc Type',
T0.[BaseEntry] AS 'Base DocEntry',
T2.[DocNum] AS 'AR Invoice Number',
T2.[CardCode] AS 'Customer Code',
T2.[CardName] AS 'Customer Name'
FROM IBT1 T0
INNER JOIN OITM T1 ON T0.[ItemCode] = T1.[ItemCode]
LEFT JOIN OINV T2 ON T0.[BaseType] = 13 AND T0.[BaseEntry] = T2.[DocEntry]
WHERE T0.[DistNumber] = '[ENTER_BATCH_NUMBER]'
ORDER BY T0.[DocDate] DESC
SAP HANA
SELECT
T0."DistNumber" AS "Lot No.",
T0."ItemCode" AS "Item Code",
T1."ItemName" AS "Item",
CASE T0."Direction"
WHEN 0 THEN 'Inbound'
WHEN 1 THEN 'Outbound'
END AS "Movement Type",
T0."Quantity" AS "Quantity",
T0."DocDate" AS "Document Date",
T0."BaseType" AS "Source Document Type",
T0."BaseEntry" AS "Source Document Entry",
T2."DocNum" AS "Sales Invoice No.",
T2."CardCode" AS "Customer Code",
T2."CardName" AS "Customer"
FROM IBT1 T0
INNER JOIN OITM T1 ON T0."ItemCode" = T1."ItemCode"
LEFT JOIN OINV T2 ON T0."BaseType" = 13 AND T0."BaseEntry" = T2."DocEntry"
WHERE T0."DistNumber" = '[ENTER_BATCH_NUMBER]'
ORDER BY T0."DocDate" DESC
replace [ENTER_BATCH_NUMBER] with the lot number you want to track. The filter BaseType = 13 corresponds to Sales Invoices. However, you can also join other tables like OPOR (Purchase Orders) or ODLN (Deliverables) to complete bidirectional traceability.



Advanced variations and use cases
In addition to the previous queries, there are other practical applications of batch management in SAP Business One that are worth exploring:
Lots in production orders: If your company manufactures products, you can configure SAP B1 so that each production order automatically generates a batch number for the finished item. In this way, the final product's batch is linked to the batches of the consumed raw materials, completing backward traceability. Consequently, if there is a defect in a raw material batch, you can identify all affected finished products in minutes.
Warehouse transfers: When you transfer inventory between warehouses, SAP Business One retains the batch number at the destination. Therefore, you do not lose traceability even if the product changes its physical location within your operation.
Serial numbers for high-value equipment: For products such as machinery, electronic equipment, or measuring instruments, the serial number is preferable to the lot number. The tables OSRN (series in stock) and SRI1 (series movements) work analogously to ITTO e IBT1, so the queries are structurally similar. Likewise, the serial numbers can be linked directly to the Service Contracts module to manage after-sales warranties.
Expiration tracking by warehouse: You can filter Query 1 by a specific warehouse so that each warehouse manager sees only the lots under their responsibility. This simplifies daily operations and eliminates irrelevant information overload.
Best practices and common mistakes
Throughout multiple SAP Business One implementations, these are the most frequent errors in batch management:
Error 1 — Activate lots with existing stock without initial adjustment: If you have items in stock and activate batch management without making the initial inventory adjustment, SAP will have a balance with no batch assigned. This generates operational blocks on the next issues. The solution is simple: always perform the initial batch inventory before processing any other movement for that item.
Error 2 — No egress policy defined: Letting each operator choose the batch at the time of dispatch creates chaos in expiration control. Therefore, formally define whether your company operates with FIFO or FEFO, configure SAP B1 to suggest the correct batch automatically, and train your team accordingly.
Error 3 — Failing to configure the expiration warning: SAP Business One has the option to alert when a batch is close to expiring, but it requires explicit configuration in the item master data. Without this configuration, expired batches can be shipped without the system warning, exposing the company to claims and legal risks.
Error 4 — Lots with incomplete data: Recording only the batch number without the manufacturing or expiration date significantly reduces the value of traceability. Ensure your receiving process includes capturing all relevant batch data from the supplier's physical document.
Key best practice: Integrate batch management with the SAP Business One Alerts module. This way, the system will send automatic notifications when there are batches nearing expiration or items with a balance that have no batch assigned, before they become an operational issue.
Official SAP resources
To delve deeper into the advanced batch management configuration, check out the following resources:
- SAP Help Portal – SAP Business One DocumentationOfficial documentation with all batch module configuration parameters.
- SAP Community – SAP Business OneForums with real cases and solutions from other implementers and consultants.
- SAP Blog – Business OneTechnical and functional articles on the latest system updates.
Conclusion: Traceability is not a luxury, it is a competitive advantage
The SAP Business One batch management It is one of the most underutilized modules in the implementations I have analyzed. Companies processing thousands of units a month continue to operate without real traceability, exposing themselves to regulatory, reputational, and operational risks that could be avoided with a relatively simple configuration.
However, the true value lies not just in activating the module. It lies in combining it with SQL queries that turn data into concrete operational decisions: which batches expire this week, which customers received a specific batch, how an item flows from the supplier to the final customer.
If you want the complete code, the advanced variations of these queries, and the step-by-step guide to configure the automatic batch exit policy, all of that is available exclusively to members of the Strategic Circle at hectorpincheira.com. Access to the complete tutorial also includes queries for serial number traceability and integration with the SAP Business One warranty module.




