Document OCRSAP Business One Agent view

How to add document OCR to SAP Business One

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.

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.

What teams use it for

Supplier invoice to A/P Invoice draft

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

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

Packing slip to Goods Receipt

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

Certificates of conformance and mill certs

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

Customs and freight documents

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

Expense and utility bills

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

SAP Business One integration 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

  1. 1

    Collect the documents

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

  2. 2

    OCR and layout analysis

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

  3. 3

    Resolve the vendor

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

  4. 4

    Find the base documents

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

  5. 5

    Check tolerances

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

  6. 6

    Create the draft

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

  7. 7

    Review and learn

    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.

  1. Extract header and lines; all confidence scores are above the threshold.
  2. Find PO 4417 and the posted Goods Receipt for the same lines.
  3. Create an A/P Invoice draft based on the receipt, with prices from the invoice.
  4. 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.

  1. Extract heat number, grade and quantity.
  2. Match to the Goods Receipt row batch by heat number.
  3. Attach the certificate and add a reference in a batch UDF.
  4. 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.

Keeping data 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 checklist

  • 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.

Ways to get it done

SAP or partner capture product for B1

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

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

Open-source OCR plus custom Service Layer integration

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

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

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

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

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

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.

Frequently asked questions

Does SAP Business One include OCR?

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?

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?

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?

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?

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.

Want Document OCR working on your SAP Business One?

A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.

Get a free assessment