What SAP invoice OCR does
SAP invoice OCR reads a supplier invoice from a scan or PDF and returns its fields: supplier, invoice number, date, amounts, tax, PO number and line items. OCR in SAP invoice management covers only that reading step. The fields are then matched to an SAP vendor and tax code, checked, and posted through MIRO (PO invoices) or FB60 (no PO).
- PostNow.ai Document AI reads the whole PDF with an AI model. Each field comes back with a confidence score (header fields also with the text as printed), a person reviews the flagged ones, and the invoice is simulated in SAP before it posts through
BAPI_INCOMINGINVOICE_CREATE1(MIRO) orBAPI_ACC_DOCUMENT_POST(FB60). - Reading is not posting. A printed supplier name is not a vendor number and "19%" is not a tax code. That translation is configuration and review work, and it decides whether an OCR'd invoice posts.
This guide covers the reading step and its hand-over to SAP. The full document pipeline (capture, classification, approvals) is in SAP intelligent document processing, and posting invoices from a file is in SAP MIRO mass invoice posting.
What SAP invoice OCR does, and where it stops
PostNow.ai Document AI treats reading and posting as two separate steps, and any invoice OCR project should plan them separately. Text recognition turns pixels into characters. Invoice OCR goes one step further and puts names on them: this string is the invoice number, that one the gross amount. What it returns is the invoice as the supplier printed it, and SAP needs it in SAP's own terms:
| What OCR returns | What SAP needs before it posts |
|---|---|
| Supplier name and address as printed | A vendor number from the vendor master; for a PO invoice, SAP takes the supplier from the purchase order |
| A tax rate, such as "VAT 19%" | A tax code from your company code's tax procedure, with the tax amount per code |
| A date in the supplier's format, such as 03.11.2026 or 11/03/2026 | A document date and a posting date in an open posting period |
| A PO number, wherever the supplier printed it | The PO number and the PO item each invoice line belongs to |
| Totals printed on the page | A document that balances: gross amount equal to the net lines plus tax |
The left column is the OCR's job; the right column is configuration and review. Plan both, and judge any OCR tool by how it handles the right column too.
How PostNow.ai Document AI reads an invoice and posts it to SAP
PostNow.ai Document AI is a licensed module of the PostNow.ai web portal, switched on per customer account. On its posting screen, an invoice goes from PDF to SAP document number in six steps:
- Upload. AP drops the invoice PDF on the posting screen.
- Extract. An AI model reads the whole PDF and returns the header (vendor name, vendor tax ID, invoice number, invoice date, currency, PO reference, net and gross amount), every line (description, quantity, unit price, amount, PO item) and the tax lines. Each field carries a confidence from 0 to 1; header fields and tax lines also carry the text as printed. A field that is not on the page comes back empty with confidence 0: the model is instructed never to invent a value.
- Route. An invoice with a PO number goes the MIRO way; one without goes the FB60 way.
- Review. The reviewer sees the invoice sheet with every field editable. Fields below 0.85 confidence are flagged, and the arithmetic is checked to the cent: lines against net, net plus tax against gross. With vendor lookup switched on, Find in SAP searches the vendor master (
LFA1) by name, and the reviewer picks the vendor number. - Simulate in SAP. SAP checks the invoice as it would a real posting and returns its messages; the simulation ends with a rollback instead of a commit.
- Post to SAP. PostNow.ai confirms which SAP system, client and user it is connected to, calls the BAPI and commits only when SAP returned no error or abort message. The SAP document number appears on the invoice, and an invoice already being posted cannot be posted a second time.
Configuration decides what the BAPI receives: default company code and document types, a table that turns each tax rate into your tax code, the expense G/L account and cost center for non-PO invoices, and vendor coding rules per supplier. Admins and designers maintain these settings; operators cannot change them. The licence also includes an operations workspace for intake, duplicate flags, approvals and a PO and goods receipt pre-check; SAP intelligent document processing walks through it.
Template OCR vs AI extraction for supplier invoices
PostNow.ai Document AI uses AI extraction: the model reads the text and the layout of the whole page together and fills one fixed invoice schema, whatever the supplier's layout or language. Template OCR works the other way round. Someone defines, per supplier layout, where each field sits on the page (a zone, an anchor word such as "Invoice No."), and the engine reads those positions. Both read text; they differ in what they need from you and where they break.
| Situation | AI extraction (PostNow.ai Document AI) | Template OCR |
|---|---|---|
| Setup per supplier | None; one schema for all suppliers | A template per layout, built and tested before that supplier's first invoice |
| Supplier changes its layout | Fields are found by what they mean, not where they sit | The template has to be repaired; until then the fields come back wrong or empty |
| New or one-off supplier | Read like any other invoice | Falls back to manual keying, or a template for one invoice |
| Line table over two pages | All lines returned in order, from the whole document | Needs table rules for page breaks and repeated headers |
| How you know a value is uncertain | Confidence per field, plus the printed text for header fields | Character-level confidence or a failed zone |
| Main risk | A confident wrong value, such as a misread date order | A silently shifted zone after a layout change |
Template OCR still suits a small, stable supplier base with fixed layouts. Once the long tail of suppliers grows, template upkeep becomes the work. In either case a person reviews what matters for payment: supplier, invoice number, date and gross amount.
Invoice fields OCR reads, and the SAP field each one fills
PostNow.ai Document AI maps the extracted invoice to SAP's own BAPI fields, and this table is that built-in map: what is read from the invoice, and where it lands in the MIRO BAPI (BAPI_INCOMINGINVOICE_CREATE1) and the FB60 BAPI (BAPI_ACC_DOCUMENT_POST).
| Read from the invoice | MIRO (PO invoice) | FB60 (non-PO invoice) | What to watch |
|---|---|---|---|
| Invoice number | HEADERDATA-REF_DOC_NO | DOCUMENTHEADER-REF_DOC_NO | Lands in the reference field (XBLNR), which SAP's duplicate check reads |
| Invoice date | HEADERDATA-DOC_DATE | DOCUMENTHEADER-DOC_DATE | Read as a date, then sent as YYYYMMDD; day-month order differs by country |
| Posting date | HEADERDATA-PSTNG_DATE | DOCUMENTHEADER-PSTNG_DATE | Not on the invoice: set at posting, otherwise the invoice date is used |
| Currency | HEADERDATA-CURRENCY | CURRENCYAMOUNT-CURRENCY on every line | A fallback currency in the settings covers invoices that print only a symbol or nothing |
| Gross amount | HEADERDATA-GROSS_AMOUNT | Vendor line in CURRENCYAMOUNT-AMT_DOCCUR, negative | Must equal net plus tax; the review checks it to the cent |
| Supplier | From the purchase order | ACCOUNTPAYABLE-VENDOR_NO | A default vendor number, or the one picked with Find in SAP |
| PO number | ITEMDATA-PO_NUMBER on every line | None: no PO means FB60 | Its presence decides the route |
| PO item per line | ITEMDATA-PO_ITEM | None | If the invoice prints no item numbers, lines are taken as 10, 20, 30 in order |
| Line amount | ITEMDATA-ITEM_AMOUNT (net) | One G/L line each, CURRENCYAMOUNT-AMT_DOCCUR | Lines must add up to the net amount |
| Line quantity | ITEMDATA-QUANTITY | Not posted | Drives SAP's quantity check against the goods receipt |
| Line description | Not posted | ACCOUNTGL-ITEM_TEXT, first 50 characters | Becomes the line text of the G/L posting |
| Tax rate and amount | TAXDATA-TAX_CODE and TAX_AMOUNT | ACCOUNTTAX line with its base amount | Each printed rate must have a tax code in the settings |
| Vendor tax ID | Extracted and shown for review | Useful to confirm the right supplier when names are alike | |
Three values never come from the invoice: the company code and document type (RE for MIRO and KR for FB60 unless you set others) come from the settings, and on FB60 the G/L account and cost center come from a vendor coding rule or the defaults. Tax is passed as an amount per tax code rather than left for SAP to calculate.
From OCR result to MIRO (PO invoices) or FB60 (non-PO invoices)
PostNow.ai Document AI routes each invoice by one fact the extraction reports: whether a PO number is on it. That choice matters more than any single field, because the two postings do different things in SAP:
- PO invoice: MIRO. The invoice lines refer to PO items, so SAP takes the supplier, G/L account and account assignment from the purchase order, runs the price and quantity checks against the goods receipt, and clears the GR/IR account. Posting the same invoice through FB60 would leave the PO open for invoicing and the GR/IR balance uncleared. Bulk MIRO from a file is covered in SAP MIRO mass invoice posting.
- Non-PO invoice: FB60. Nothing to match against: the vendor line, one G/L line per invoice line and the tax lines must be complete in the posting itself, and the debits and credits must sum to zero. The G/L coding comes from the vendor coding rule or the defaults. Bulk FB60 from Excel is covered in SAP FB60 mass upload.
Most misroutes are a PO number the supplier printed somewhere unusual, or not at all. In the operations workspace a reviewer can change the classification, and the change is recorded. On the posting screen the reviewer corrects a misread PO number in place, and an invoice on the MIRO route with no PO number is stopped before SAP with "PO reference is required to post via MIRO but is missing".
Checks before an OCR'd invoice posts
PostNow.ai Document AI stops an invoice before it reaches SAP when the extracted data cannot make a valid posting, and names the field to fix. These are the checks on the posting screen and the messages the reviewer sees:
| Check | Message on the posting screen |
|---|---|
| Lines add up to net | "Line items sum to … but net amount is … (Δ …)" |
| Net plus tax equals gross | "Net + tax = … but gross amount is … (Δ …)" |
| Every tax rate has a tax code | "No SAP tax code configured for the 19% rate" |
| A PO invoice has its PO number | "PO reference is required to post via MIRO but is missing" |
| The vendor is chosen | "Vendor lookup is enabled but no SAP vendor was chosen" |
| Date, gross amount and lines are present | "Invoice date is missing", "Gross amount is missing", "Line item 3 has no amount" |
Then SAP checks the invoice itself, first in Simulate in SAP and again at posting: vendor, PO item, tax code, posting period, balance, and for PO invoices the price and quantity against the tolerance limits. An invoice above tolerance still posts and is blocked for payment; how that works, and how blocked invoices are released, is in SAP invoice matching.
Duplicate invoices: catch them before SAP
SAP's duplicate check compares the reference (the supplier's invoice number) with earlier invoices: message M8 108 in MIRO, with the criteria set per company code in OMRDC, and F5 117 in FI postings, for vendors with the Check double invoice flag. Both need the invoice number in the reference field, which is why OCR has to read it exactly. Two SAP KBAs matter for any OCR route that posts through an interface: KBA 1859210 describes that logistics invoice verification does not check for duplicates when invoices come in through BAPI, EDI or API (KBA 2036775 describes how to enable it), and KBA 2389365 describes that F5 117 is not raised for documents posted through BAPI_ACC_DOCUMENT_POST.
So the duplicate check belongs in the OCR step. In PostNow.ai Document AI that is the operations workspace: a file whose content has arrived before is flagged as an exact duplicate on intake, and after extraction an invoice with the same invoice number (compared without punctuation and leading zeros), the same vendor, a gross amount within 0.5% and a date within 5 days of an earlier one is flagged as a near-duplicate. Those are the defaults; the tolerances are configurable. An open flag blocks submission until someone decides.
Worked example: a five-line PO invoice from PDF to MIRO
PostNow.ai Document AI takes this invoice from PDF to a posted MIRO document. A supplier invoices company code 1010 against PO 4500001934: invoice number RE-2026-04417, printed date 03.11.2026, five lines, 19% VAT. The settings map 19% to tax code V1; the PP tolerance key for 1010 has an upper limit of 2% and 20.00 EUR.
| Line | Printed on the invoice | Extracted | Lands in ITEMDATA |
|---|---|---|---|
| 1 | Pos. 10, TG-1001 hex bolt M8, 400 PC × 0,45 = 180,00 | qty 400, amount 180.00, PO item 10 | PO_ITEM 00010, QUANTITY 400, ITEM_AMOUNT 180.00 |
| 2 | Pos. 20, TG-1002 washer M8, 400 PC × 0,08 = 32,00 | unit price 0.08, flagged below 0.85 confidence | PO_ITEM 00020, ITEM_AMOUNT 32.00 |
| 3 | Pos. 30, TG-1003 bracket, 50 PC × 12,60 = 630,00 | qty 50, amount 630.00 | PO_ITEM 00030, ITEM_AMOUNT 630.00 |
| 4 | Pos. 40, TG-1004 cable ties, 20 PAK × 3,90 = 78,00 | qty 20, amount 78.00 | PO_ITEM 00040, ITEM_AMOUNT 78.00 |
| 5 | Pos. 50, TG-1005 work gloves, 30 PAA × 4,50 = 135,00 | qty 30, amount 135.00 | PO_ITEM 00050, ITEM_AMOUNT 135.00 |
- Header. The model returns invoice date 2026-11-03 next to the printed 03.11.2026, so the reviewer can see it was read as 3 November and not 11 March. Net 1,055.00, VAT 200.45, gross 1,255.45 EUR; PO reference
4500001934, so the invoice is routed to MIRO. - Review. Line 2 is flagged: the reviewer checks 0.08 against the PDF and confirms it. The arithmetic check passes: 180.00 + 32.00 + 630.00 + 78.00 + 135.00 = 1,055.00, and 1,055.00 + 200.45 = 1,255.45. Find in SAP returns supplier
100045for the printed name. - Mapping.
REF_DOC_NO=RE-2026-04417,DOC_DATE=20261103,GROSS_AMOUNT= 1255.45,CURRENCY= EUR,COMP_CODE= 1010,DOC_TYPE= RE; every line carriesPO_NUMBER4500001934and tax codeV1;TAXDATAholds V1 with 200.45. - Simulate in SAP. SAP checks the invoice against the PO and goods receipt and returns warning
M8 082(price too high) for line 3 but no error; the simulation is rolled back and the reviewer posts. - Post to SAP. SAP posts invoice document
5105602011, and the number appears on the invoice. The warning came from line 3, which bills 12.60 EUR against a PO price of 12.00 EUR: 0.60 × 50 = 30.00 EUR and 5%, above both PP limits. BecauseM8 082is a warning in this system, SAP posts the invoice and blocks it for payment; the buyer confirms or disputes the price, and the block is released in MRBR.
Had the supplier printed no item numbers, the five lines would have gone to PO items 10 to 50 in printed order, which is right here and wrong for a supplier who lists items in its own order. For such suppliers, check the PO item of every line in the review.
Scan quality: what makes OCR misread an invoice
PostNow.ai Document AI reads PDFs, and the PDFs that cause the most review work are scans of paper. A PDF the supplier generated from its billing system carries clean text; a scan is a picture of a page, and every flaw in the picture becomes a reading problem. The usual causes, and what to do about them:
| Problem | What it does to the read | Fix at the source |
|---|---|---|
| Low resolution | Similar characters blur together: 0 and 8, 1 and 7, comma and full stop | Scan at 300 dpi or more; the Tesseract OCR documentation names 300 dpi as the level it works best at (Tesseract: improving quality) |
| Skewed or rotated pages | Table rows drift into each other, so a quantity lands on the wrong line | Feed paper straight; switch on automatic deskew in the scanner software |
| Stamps, handwriting, highlighter | A "received" stamp over the total or a hand-written note over a line hides the printed value | Stamp the back or a margin, never the amounts; scan before anyone annotates |
| Fax and copy-of-a-copy | Noise and broken characters across the whole page | Ask the supplier for the original PDF |
| Several invoices in one file | Two invoices are read as one, with the wrong totals | One invoice per PDF; split batch scans before upload |
| Multi-page line tables | Lines are lost or repeated at page breaks | Keep all pages of an invoice in one file, in order |
The cheapest fix is upstream: ask the suppliers who still post paper to email the PDF their billing system already produces.
When you don't need OCR: e-invoices
PostNow.ai Document AI reads invoices that exist as a page; a structured e-invoice already exists as data, so there is nothing to recognise. An e-invoice carries the fields as XML, either on its own or embedded in a PDF:
- Pure XML. XRechnung, a German e-invoice format, is an XML file with no page to read (KBA 3532707 lists it as "XRechnung (pure XML)").
- Hybrid PDF. ZUGFeRD in Germany and Factur-X in France are a readable PDF/A-3 with the XML invoice embedded in the file (PDFlib: ZUGFeRD and Factur-X). Reading the embedded XML is exact; reading the page is not.
- Networks. Peppol carries e-invoices between registered parties, and EDI connections deliver invoices as messages straight into SAP.
Where suppliers send e-invoices, the data arrives without OCR. On the SAP side, electronic supplier invoices can be received with SAP Document and Reporting Compliance, cloud edition (SAP Help: Receiving Electronic Supplier Invoices); the scope differs by country and release. Every invoice that still arrives as a scan or a plain PDF needs the reading step, and the duplicate check above applies to both routes.
SAP's own invoice OCR options
PostNow.ai Document AI runs alongside your SAP system and posts through BAPIs; SAP also offers its own ways to read invoices. Two of them:
- SAP Document AI. SAP Document Information Extraction, part of SAP Document AI on SAP Business Technology Platform, captures structured data from business documents such as invoices, using SAP's machine learning models, generative AI or templates. SAP's own learning material advises: "Always validate information extracted using SAP Document AI before using it for critical applications" (SAP Learning).
- SAP Invoice Management by OpenText. An add-on to SAP ERP 6.0 and SAP S/4HANA that automates the processing of incoming invoices; OpenText calls it Vendor Invoice Management for SAP Solutions (VIM) (SAP Help). OCR capture of paper and PDF invoices is part of its setup.
How SAP Document AI compares with PostNow.ai Document AI stage by stage is in SAP intelligent document processing; the wider payables process, from receipt to payment, is in SAP accounts payable automation.
What to plan for with SAP invoice OCR
PostNow.ai Document AI covers reading, review and posting; these decisions sit with AP and the SAP team before the first invoice goes through.
- A tax code for every rate your suppliers print. Map each rate once in the settings, including 0% and reduced rates, so no invoice stops on a missing code.
- The vendor route. Choose between one default vendor number and Find in SAP per invoice; with many suppliers, the lookup is the one that scales.
- G/L coding for non-PO suppliers. A vendor coding rule per regular supplier (G/L account, cost center, tax code, document type) keeps FB60 postings from falling back to one default account.
- One purchase order per invoice. The PO number from the invoice header goes on every line, so ask suppliers to invoice each order separately, or post invoices that cover several orders in MIRO.
- Fields a person always checks. Invoice date, supplier, gross amount and PO number, whatever the confidence: a confident wrong date moves the due date, a confident wrong PO number hits the wrong order.

