SAP AP + document AI
AI Invoice Reader for SAP: From PDF to a Checked MIRO Draft
Short answer
An AI invoice reader for SAP extracts header and line data from supplier invoices, matches it to purchase orders and goods receipts, and creates a parked or draft invoice for an AP clerk to post. SAP Document AI and established tools such as OpenText VIM already do this well for standard flows; a private model helps with messy formats, sensitive suppliers, on-prem requirements and explaining blocked invoices.
- ERP
- SAP S/4HANA, SAP ECC 6.0, SAP Document AI
- Industries
- Manufacturing, Aerospace, Electronics, Industrial Machinery
- Written for
- Accounts Payable Manager
Accounts payable in SAP has been automated for years, yet most AP teams still key a large share of invoices by hand. The reasons are familiar: supplier layouts vary endlessly, scanned PDFs are poor, line items do not match PO lines one to one, freight and surcharges appear in odd places, and anything with a credit or partial delivery breaks the template.
The modern generation of document AI handles variation far better than template OCR. SAP Document AI, formerly Document Information Extraction, extracts fields from invoices and other business documents and is integrated into SAP's own invoice processes in cloud editions. OpenText Vendor Invoice Management is a long-established choice for SAP AP workflow. If you run one of these and your extraction rates are acceptable, improve configuration before replacing anything.
Private models make sense in a few clear cases: when invoices contain controlled or highly sensitive data that cannot go to a cloud service, when you run ECC without BTP, when supplier formats are unusual enough that general extraction struggles, or when the real problem is not extraction but understanding why hundreds of invoices sit blocked in MRBR.
This page explains the full chain from email inbox to posted invoice, what each option does well, and how to keep AP controls intact.
What usually gets in the way
The problems we hear most from accounts payable manager teams running SAP S/4HANA.
Manual keying of variable layouts
Template-based OCR breaks on new suppliers and layout changes, so clerks fall back to keying header and lines into MIRO.
Line matching fails
Supplier line descriptions and units rarely match PO lines exactly; quantities, partial deliveries and surcharges need judgement.
Blocked invoices pile up
Invoices blocked for price or quantity variances sit in MRBR with little context, and resolving each means checking PO history, receipts and buyer emails.
Duplicate invoices slip through
Variations in invoice number format, dates and amounts defeat simple duplicate checks, leading to duplicate payments recovered only by audit.
Sensitive suppliers and data
Defense and aerospace invoices may reference program numbers or controlled items, raising questions about sending them to external cloud services.
Where AI earns its place in SAP S/4HANA
Each use case names the ERP objects it reads or writes, so your ERP team can judge the integration effort before anyone commits budget.
Header and line extraction
Extract supplier, invoice number, dates, currency, tax and line items from PDFs and scans, with confidence scores per field.
Touches: Supplier master (LFA1), company code, tax codes, invoice lines
Outcome: Most fields captured automatically; low-confidence fields highlighted for review.
PO and goods receipt matching
Match extracted lines to PO items and goods receipts, handling unit conversions, partial deliveries and split lines.
Touches: EKKO/EKPO, EKBE history, goods receipts (MSEG/MATDOC), GR-based invoice verification
Outcome: More invoices reach a postable draft without manual line matching.
Draft invoice creation
Create a parked invoice or draft through the standard API so an AP clerk reviews and posts it in MIRO or the Fiori app.
Touches: BAPI_INCOMINGINVOICE_PARK, BAPI_INCOMINGINVOICE_CREATE, supplier invoice API in S/4HANA
Outcome: Clerks review and post instead of keying, with SAP's own checks applied at posting.
Blocked invoice explanation
For each blocked invoice, explain the variance, show the PO price history and receipts, and draft a message to the buyer.
Touches: RBKP/RSEG, MRBR, tolerance keys (OMR6), blocking reasons, buyer assignment
Outcome: Faster release decisions and a shorter blocked invoice backlog.
Duplicate detection
Compare new invoices against history using normalised invoice numbers, amounts, dates and supplier, catching near duplicates.
Touches: RBKP, BSIK/BSAK vendor items, supplier master
Outcome: Fewer duplicate payments reaching the payment run.
Non-PO invoice coding suggestions
Suggest G/L account, cost center and tax code for non-PO invoices based on supplier history and invoice content.
Touches: FB60 postings history, G/L accounts (SKA1/SKB1), cost centers (CSKS)
Outcome: Faster, more consistent coding, still approved by a person.
Supplier statement reconciliation
Read supplier statements and compare them with open items to identify missing invoices, unapplied credits and disputes.
Touches: Vendor open items (BSIK), payments (BSAK), supplier statements
Outcome: Reconciliation issues found early rather than at quarter end.
Reference architecture
Invoices arrive by email or scan, are extracted by SAP Document AI, an existing AP tool, or a private model, matched against SAP purchasing data, and land as parked documents for review. SAP's own tolerance and posting checks remain the control.
- 1
Capture
Monitored AP mailbox, scanning and supplier portal feeds, with documents stored in your archive.
- 2
Extraction
SAP Document AI, OpenText VIM or a private vision-language model, chosen per your landscape and data constraints.
- 3
Matching and validation
Rules and model reasoning that match lines to PO items and receipts, check supplier bank details against master data and flag duplicates.
- 4
SAP posting interface
Parked invoices through standard BAPIs in ECC or supplier invoice APIs in S/4HANA, never direct table writes.
- 5
Review and exceptions
AP clerks review drafts; blocked invoice explanations route to buyers with context.
Integration notes for your ERP team
- Use BAPI_INCOMINGINVOICE_PARK on ECC to create parked documents a clerk completes in MIRO.
- On S/4HANA, use the released supplier invoice API rather than direct BAPI calls where available.
- Respect tolerance keys configured in OMR6; the AI should explain variances, not bypass them.
- Never take bank details from an invoice; validate against the supplier master and flag differences as fraud risk.
- Store extracted fields, confidence and the source image link with the parked document for audit.
- Measure touchless rate and correction rate per supplier to target improvement where it matters.
Deployment options
SAP Document AI on BTP
S/4HANA and BTP customers with standard invoice flows and no restriction on cloud processing.
Native integration, maintained by SAP, priced through BTP or included where SAP bundles it.
Existing AP suite plus AI for exceptions
Companies already running OpenText VIM or similar.
Keep the workflow tool; add AI for blocked invoice explanation and difficult formats.
Private on-prem extraction
Defense and aerospace suppliers, ECC without BTP, or highly sensitive invoices.
A private vision-language model extracts and matches on your servers, posting parked invoices through BAPIs.
Compliance and data control
How the architecture supports your obligations. Certification and accountability stay with your organisation; the design keeps the evidence straightforward.
SOX
AI creates parked invoices only; posting, release of blocks and payment remain with authorised users under existing tolerances and segregation of duties.
Tax and e-invoicing rules
Where structured e-invoices are mandated, use the structured data directly; AI extraction applies to PDFs and scans, with tax codes validated against SAP configuration.
ITAR / EAR
Invoices referencing controlled items can be processed entirely on-prem, supporting the customer's export control obligations.
Fraud controls
Supplier bank details are checked against master data, never taken from the invoice, and changes to bank details follow your verified change process.
How an engagement runs
Phase 1 . 1-2 weeks
AP baseline
- -Invoice volume and touchless rate by supplier
- -Blocked invoice analysis
- -Current tool review
Phase 2 . 1 week
Option decision
- -SAP-native vs existing suite vs private comparison
- -Data constraint review
- -Recommendation
Phase 3 . 4-6 weeks
Pilot
- -Extraction on top suppliers
- -Parked invoice creation
- -Blocked invoice explainer
Phase 4 . 4 weeks
Rollout
- -Supplier coverage expansion
- -Monitoring dashboards
- -Control documentation
Questions to ask any vendor, including us
A short list that separates real SAP S/4HANA AI work from a chatbot demo.
- What extraction rate do we get today with SAP Document AI or our current tool, measured per supplier?
- Does the AI create parked invoices, or can it post directly?
- How does it handle partial deliveries, unit conversions and freight lines?
- Where are invoice images processed and stored?
- How does it detect duplicates beyond exact invoice number matches?
- What protects us from bank detail fraud?
Frequently asked questions
What is SAP Document AI?
SAP Document AI, previously called Document Information Extraction, is an SAP BTP service that extracts structured data from business documents such as supplier invoices, purchase orders and payment advices. It is integrated into some SAP cloud processes and can be used through APIs. For S/4HANA and BTP customers with standard invoice flows, it is a natural option to evaluate first.
Should we replace OpenText VIM with AI?
Usually not. VIM provides workflow, exception routing and audit trails that AP teams depend on. Modern AI improves extraction and explains exceptions, and it can work alongside VIM. Replacing a functioning AP workflow tool is a large project; adding AI to the hardest invoices and to blocked invoice resolution is usually where value is fastest.
Can AI post invoices in SAP automatically?
Technically yes, but most companies should start with parked invoices that a clerk reviews and posts. Once extraction and matching are proven for specific suppliers with stable formats, some move to automatic posting for low-value, fully matched invoices, always under SAP's tolerance checks. Release of blocked invoices and payment should stay with people.
How does AI help with blocked invoices?
It gathers the context a clerk or buyer needs: the variance type, PO price history, goods receipt quantities, any price changes on the PO and relevant emails, then writes a short explanation and suggested action. Resolution still requires a decision, but the investigation time drops sharply, which is what shrinks the MRBR backlog.
Does this work on SAP ECC?
Yes. Extraction is independent of the ERP, and ECC offers standard BAPIs to park and create incoming invoices and to read purchasing history. ECC customers without BTP often prefer a private extraction model on-prem, which avoids adding cloud services just for AP.
How accurate is AI invoice extraction?
For common invoice layouts and good scans, header fields are extracted reliably and line items reasonably well; accuracy drops with poor scans, handwritten notes and complex multi-page line tables. Measure per supplier during a pilot, use confidence scores to route uncertain fields for review, and track correction rates over time rather than relying on a single headline number.
Is it safe to process invoices with a cloud AI service?
For most commercial invoices, reputable services with suitable data processing terms are acceptable. Invoices referencing controlled items, defense programs or highly confidential pricing may need on-prem processing under your policies. Classify invoice types by sensitivity and route them accordingly rather than making one decision for all.
Related guides
AI for accounts payable invoice matching in your ERP
On-prem AI reads vendor invoices, runs 3-way match against your ERP PO and receipt, and routes only real exceptions to your AP team. No invoice data leaves your network.
S/4HANA MM procurement AIAI for SAP S/4HANA Procurement (MM) That Reads POs, Receipts and Invoices Together
AI for SAP S/4HANA procurement: query purchase orders, goods receipts and invoice matching in plain English, on-prem if needed, read-only by default.
S/4HANA FI/CO close AIAI for SAP S/4HANA Finance Close (FI/CO) That Traces the Universal Journal for You
AI for SAP S/4HANA financial close: query the universal journal, trace allocations and variances, and manage close tasks. On-prem option, read-only by default.
SAP BTP + self-hosted AISAP BTP and a Private LLM: Where the Generative AI Hub Fits and Where It Doesn't
Where SAP BTP's Generative AI Hub fits and where a self-hosted LLM belongs instead. CAP, Integration Suite, and an architecture decision framework.
SAP security + AISAP AI Security: How to Let an LLM Read SAP Data Without Breaking Your Authorisation Model
SAP AI security: technical users, PFCG roles, S_RFC and OData scope, prompt injection from long texts, audit logging and SoD when AI reads SAP data.
SAP S/4HANA + private AIAI for SAP S/4HANA, Running On-Prem or in Your Private Cloud
Run AI on SAP S/4HANA without sending ERP data to a public API. On-prem and private-cloud architecture, CDS views, OData, and honest deployment trade-offs.
Plan it with numbers
SAP Invoice Verification Tolerance Calculator
Simulates the price and quantity variance checks behind MIRO invoice blocks so you can test tolerance limits before changing OMR6.
Free ToolSAP BAPI_PO_CREATE1 ABAP Skeleton Generator
Fill in vendor, plant and material to generate an ABAP skeleton for creating a purchase order with BAPI_PO_CREATE1.
Free ToolSAP Open Purchase Order Items ABAP SELECT Generator
Builds an ABAP report that selects open PO schedule lines with open quantity from EKKO, EKPO and EKET, filtered by purchasing organisation, plant, document type and date.
GuideAP Invoice Automation in ERP: The Complete Guide
AP invoice automation in ERP explained: touchless capture, 3-way matching, approval routing, and AI agents that cut invoice processing costs by up to 80%.
GuideAI Document Processing for ERP: Invoices, POs, and Packing Slips
Automate invoice, PO, and packing slip processing into ERP with AI document extraction. Covers OCR, layout analysis, validation rules, and ERP posting.
GuideHuman-in-the-Loop Design for ERP AI
Human-in-the-loop design for ERP AI: where to place approvals, confidence thresholds, and audit trails so agents act safely inside SyteLine, LN, and M3.
Talk it through with an engineer who knows SAP S/4HANA
Bring one real question your team cannot answer from the ERP today. We will map the data path, the model, and where it runs, and tell you honestly if AI is the wrong tool for it.
Try it here, free
SAP ECC IDoc Segment Data Reader ABAP Generator (EDIDC, EDID4, EDIDS)
Choose a message type, basic type, segment and field, and get an ABAP report that lists IDocs, the value of that segment field and the last status message text.
Keep exploring
Free tools
- SAP ECC IDoc Segment Data Reader ABAP Generator (EDIDC, EDID4, EDIDS)Choose a message type, basic type, segment and field, and get an ABAP report that lists IDocs, the value of that segment field and the last status message text.
- SAP Invoice Verification Tolerance CalculatorSimulates the price and quantity variance checks behind MIRO invoice blocks so you can test tolerance limits before changing OMR6.
- SAP ECC Classic BAdI Definitions Reference (MIGO, ME21N, MIRO, Deliveries, PM Orders)Reference table of widely used BAdI definitions on SAP ECC 6.0 with interface, key methods, transactions and typical use, plus how to find a BAdI and where error messages are allowed.
ERP fixes and how-tos
- SAP MIRO: invoice blocked for price variance, and how to release it in MRBRWhy SAP MIRO blocks an invoice for price or quantity variance, how tolerance keys in OMR6 decide it, and how to release or reject it in MRBR safely.
- SAP MM Errors and Solutions: The Common Ones, by Process StepCommon SAP MM errors by process step, with cause and fix: stock deficit, closed periods, release strategy, blocked invoices and account determination.
- Freight Cost in SAP MM: Planned and Unplanned Delivery CostsHow to handle inbound freight in SAP MM: planned delivery costs on the PO, freight condition types, unplanned costs in MIRO, and the GR/IR and stock impact.
Runs with your ERP
- OpenText Vendor Invoice Management with SAP S/4HANA and ECCHow OpenText Vendor Invoice Management runs inside SAP on ECC and S/4HANA: OCR capture, exception workflow and posting, plus setup, pitfalls and options.
- AI Invoice Management and SAP S/4HANA Cloud: OCR capture and AP processingHow the AI Invoice Management SAP Store app captures invoice data with OCR and imports it into S/4HANA Cloud, plus setup steps, pitfalls and alternatives.
- SAP Ariba Invoicing with SAP S/4HANA and ECCHow SAP Ariba Invoicing captures invoices from email, PDF and images with AI OCR and routes them for matching and approval against SAP purchasing data.
Guides
- AI-Powered Document Processing for ERP SystemsAutomate invoice, PO, and packing slip processing into ERP with AI document extraction. Covers OCR, layout analysis, validation rules, and ERP posting.
- Building an AI Document Processing Pipeline: OCR to ValidationHow to build an AI document processing pipeline: OCR quality, LLM extraction, schema validation, and the human review layer that catches what slips through.
AI on your ERP
- AI for accounts payable invoice matching in your ERPOn-prem AI reads vendor invoices, runs 3-way match against your ERP PO and receipt, and routes only real exceptions to your AP team. No invoice data leaves your network.
- AI for SAP S/4HANA Procurement (MM) That Reads POs, Receipts and Invoices TogetherAI for SAP S/4HANA procurement: query purchase orders, goods receipts and invoice matching in plain English, on-prem if needed, read-only by default.
Integrations
- How to add document OCR to SAP S/4HANACapture invoices, packing slips, certificates of conformance and drawings into SAP S/4HANA with OCR, confidence thresholds, 3-way match and human review.
- How to add document OCR to SAP ECC 6.0Capture invoices, packing slips and certificates into SAP ECC 6.0 with OCR and AI: ArchiveLink, parked invoices via BAPI, confidence thresholds and human review.