# How to add document OCR to SAP Business One

> Source: https://netray.co/integrations/sap-business-one-document-ocr
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Integrations

## Short answer

Run OCR and field extraction on supplier documents, match them to Purchase Orders and Goods Receipts, and create A/P Invoice or Goods Receipt drafts through the Service Layer. Route low-confidence fields to a reviewer and keep the source document attached.

## System

SAP Business One

## Capability

document-ocr

## Intro

Accounts payable in Business One is often the place where the system's strengths run out. Supplier invoices arrive as PDFs and scans, a clerk keys the vendor, dates, lines and tax into an A/P Invoice, and a second person checks it against the PO and the receipt. Packing slips and certificates of conformance are filed in folders with no link to the receipt.

SAP offers its own document-capture options in the wider portfolio, and some B1 versions and partner products include OCR. Those are worth checking first. Where they do not fit, a custom capture pipeline over the Service Layer is a practical alternative.

The accuracy question in OCR is not the characters, it is the matching: which vendor, which PO, which lines, which tax code. That is where most of this page spends its time.

## Use Cases

### Supplier invoice to A/P Invoice draft

**Description:** Extract vendor, invoice number, date, totals, tax and lines, then create an A/P Invoice draft copied from the matching Goods Receipt PO where one exists.

### Three-way match assist

**Description:** Compare invoice lines to Purchase Order and Goods Receipt quantities and prices, flagging differences before posting.

### Packing slip to Goods Receipt

**Description:** Read supplier packing slips at the dock and prepare a Goods Receipt PO draft against the open PO.

### Certificates of conformance and mill certs

**Description:** Extract heat or lot numbers from certificates and attach them to the receipt, linking batch numbers to the certificate file.

### Customs and freight documents

**Description:** Capture freight invoice amounts and reference numbers for landed cost allocation.

### Expense and utility bills

**Description:** Extract recurring bills into A/P Invoice drafts with a default account from the vendor.

## System Surface

- Service Layer: Drafts for PurchaseInvoices (A/P Invoice) and PurchaseDeliveryNotes (Goods Receipt PO), plus copy-from behavior when a base document is referenced in row fields (BaseType, BaseEntry, BaseLine).
- Attachments2 for storing the source PDF or image and linking it to the document; the attachment path must be reachable by users who open the record.
- Batch and serial data on inbound receipts (the document row batch and serial numbers collections) for certificates tied to lots.
- Business Partner master for vendor matching: tax ID fields, bank accounts and the vendor reference name; tax codes and withholding tax setup for tax validation.
- Landed cost documents for freight and duty, a separate object from the A/P Invoice, relevant when OCR captures import charges.

## How It Works

### Collect the documents

**Detail:** Use a watched folder, scanner profile or mailbox. Keep originals immutable and assign each file an ID.

### OCR and layout analysis

**Detail:** Use a local OCR engine plus a layout-aware extractor for tables. Output header fields and line items with a confidence score per field.

### Resolve the vendor

**Detail:** Match on tax ID, bank account or remit-to address before name. Do not create vendors automatically.

### Find the base documents

**Detail:** Locate the open PO by PO number in the document, or by vendor, item and quantity. Pull the related Goods Receipt where one exists.

### Check tolerances

**Detail:** Compare price and quantity against tolerances you define, check duplicates on vendor plus invoice number, and verify tax totals.

### Create the draft

**Detail:** Post a Draft through the Service Layer, copy from base documents if matched, and attach the source file.

### Review and learn

**Detail:** Show the reviewer the document next to extracted values. Store corrections to improve vendor-specific rules.

## Example Flows

### Invoice with matching receipt

**Trigger:** A PDF invoice arrives from a regular vendor referencing PO 4417.

**Steps:**

- Extract header and lines; all confidence scores are above the threshold.
- Find PO 4417 and the posted Goods Receipt for the same lines.
- Create an A/P Invoice draft based on the receipt, with prices from the invoice.
- Price difference on line 3 exceeds tolerance, so the draft is flagged for review.

**Result:** The clerk reviews one flagged line instead of keying the whole invoice.

### Mill certificate to lot record

**Trigger:** A certificate PDF is scanned with an incoming steel shipment.

**Steps:**

- Extract heat number, grade and quantity.
- Match to the Goods Receipt row batch by heat number.
- Attach the certificate and add a reference in a batch UDF.
- Missing certificates leave the lot on a quality-hold list.

**Result:** Quality can find the certificate from the lot, and missing paper is visible before use.

## On Prem

Invoices and certificates contain pricing, bank details and sometimes controlled technical data, so many manufacturers want OCR and extraction to stay inside their network. Open-source OCR engines and layout models run on a modest server, and a local open-weight language model can handle the harder free-form extraction on a GPU box. The pipeline reads files from a share, talks to the Service Layer on the LAN, and writes drafts. The only dependency on the outside is model downloads during setup. If you use a cloud OCR service instead, check where documents are processed and retained and whether your contracts or export rules allow it.

## Security

- Restrict the integration user to creating drafts and reading master data; posting stays with AP staff.
- Verify bank detail changes by a separate process; never update vendor bank data from an invoice.
- Keep originals in write-once storage and store file hashes with the draft to detect tampering.
- Apply segregation of duties: the person who approves the extracted draft should not be the one who configures matching rules.

## Options

### SAP or partner capture product for B1

**Fit:** Best if you want a supported package for AP automation with a vendor roadmap.

**Effort:** Weeks including setup and training; licence costs apply.

### Open-source OCR plus custom Service Layer integration

**Fit:** Fits teams with developers who want control and have mostly consistent vendor layouts.

**Effort:** Six to ten weeks to a good AP draft workflow.

### Partner build with local models (Netray with a B1 partner)

**Fit:** Fits when documents must stay on-prem and layouts vary widely.

**Effort:** Scoped pilot with a few vendors, then widened.

## Pitfalls

- Judging OCR by character accuracy; measure field-level and line-level accuracy on your own invoices.
- Skipping duplicate detection leads to double payments when a vendor re-sends invoices.
- Tax code mapping by country and item type is easy to get wrong; validate against your own tax setup.
- Multi-page invoices with continued tables break naive table extraction.
- Posting automatically before measuring accuracy per vendor.

## Faq

### Does SAP Business One include OCR?

**Answer:** Not in the core client for most versions. There are SAP-related and partner products for document capture, and capabilities change by release, so check your edition before building your own.

### Can OCR create the A/P Invoice directly?

**Answer:** It can create a draft, which is the recommended step. Posting directly is possible through the Service Layer, but wise only for narrow, proven cases with matching and tolerance checks passing.

### How are scans of poor quality handled?

**Answer:** Preprocessing (deskew, contrast) helps, and low-confidence fields are routed to a reviewer. Some documents will always need manual keying; plan for that share instead of hiding it.

### Can it link certificates to batches?

**Answer:** Yes, by extracting the lot or heat number and matching it to batch numbers on the Goods Receipt row, then attaching the file. The match logic depends on how your suppliers print those numbers.

### Do I need a GPU?

**Answer:** Basic OCR runs on CPU. A language model for harder extraction runs better on a GPU, though small quantized models can work on CPU for low volumes. Size by documents per day and acceptable latency.

## Search terms

sap business one ocr, sap b1 invoice ocr, sap business one document capture, ocr supplier invoice sap business one, sap b1 accounts payable automation, scan invoices into sap business one, sap business one packing slip ocr, sap b1 three way match automation, sap business one attachments service layer, sap b1 invoice recognition

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
