Forum Navigation
You need to log in to create posts and topics.

Query - Batch Transactions by Item, Date, Document Type

SAP Business One provides very comprehensive Batch and Serial tracking. Navigating through this information can be challenging at first. Here is a quick little query you can use as is, or add parameters around it prompting for Item, Batch or Date. Either way, it does a good job of display the document type that made the transaction.

SELECT T0."ItemCode" "Item",
T0."DocDate" "Transaction Date",
T0."BatchNum" "Batch Number",
CASE
WHEN T0."BaseType" = 59 THEN 'Misc Goods Receipt'
WHEN T0."BaseType" = 18 THEN 'AP Invoice'
WHEN T0."BaseType" = 15 THEN 'Delivery'
WHEN T0."BaseType" = 60 THEN 'Misc Goods Issue'
WHEN T0."BaseType" = 17 THEN 'Sales Allocation'
WHEN T0."BaseType" = 20 THEN 'Goods Receipt PO'
WHEN T0."BaseType" = 13 THEN 'AR Invoice'
ELSE 'Other'
END "Doc Type",
T0."CardName" "Business Partner",
T0."Quantity" "Qty"
FROM IBT1 T0
ORDER BY T0."ItemCode", T0."DocDate"