Anna knows where every invoice goes. Now SAP does too.

How AI in SAP captures the know-how of your most experienced colleague in accounts payable, and keeps it when she retires.

SAP AI invoice

Ask anyone in accounts payable and they will recognise it. The same supplier sends the same invoice text, yet the invoice ends up on different accounts depending on who handles it. We talked to two of Pearl's experts, Arvid Borelius and Mads Fosgaard Eller, about how they solve it with AI, directly in SAP. Finance writes the rules, the AI suggests, and a person always has the final say.

Every finance team has an Anna

Arvid works with invoice handling in SAP every day. He describes the problem like this:

"We have the same suppliers, the same invoice texts, the same types of invoices. But the coding can look very different depending on who actually does it."

On a non-PO invoice, there is no purchase order telling SAP which account or cost center to use. So the AP accountant reads the lines and makes a call. Some read the text, think it looks fine and pick a cost center. Others take the first suggestion that comes up. The mistakes usually show up at month-end, when someone has to fix them.

And then there is Anna.

"It could be someone, let's call her Anna, who has worked in AP for decades. She knows the whole chart of accounts and exactly where everything should go. She is the key person. And she has never written it down."

New colleagues have no history to lean on. And the day Anna retires, her knowledge walks out the door with her.

Getting Anna's knowledge into the system

The solution Pearl has built starts with exactly that. Together with the customer, Pearl sits down with the most experienced people in accounts payable and turns what they know into rules, written in plain text. Each supplier gets its allowed accounts, its allowed cost centers and a rule that explains how to choose.

When an e-invoice comes in, the AI reads it, checks it against the rules and the supplier's history, and suggests account and cost center. Every suggestion comes with a short explanation of why.

There are three kinds of answers:

  • A fixed rule. This supplier always goes to this account and this cost center. "There we don't need any AI at all. No tokens are used, which saves money," says Arvid.
  • A rule with options. An industrial gas supplier can go to different accounts depending on what was bought, and to different cost centers depending on which site ordered it. The AI reads the invoice and picks the right one.
  • A qualified guess. No rule matches, so the AI looks at history and makes a suggestion. It flags the guess clearly, so someone takes a closer look.

"I know what you're thinking. We have thousands of suppliers. Do we need a rule for every single one? No. You can set umbrella rules that cover many of them, and lean on history for the rest."

The more that is covered by rules, the more consistent the result, and the cheaper the solution is to run.

AP reviews. Finance owns the rules.

For the person handling the invoice, the job changes. Instead of working out every line, they review a suggestion that explains itself. The invoice, the lines, the suggestion and earlier postings sit on one screen. If it looks right, they approve. If not, they correct it and can write why.

"The AI will never book anything on its own. A person always has to press the approve button."

For finance, the rules are theirs. They can add, change and remove them without help from IT. The same rule is used on every invoice, whoever handles it. And every approval and correction is saved in a log. That gives finance a clear picture of how often the suggestions are right, and where a rule needs to be sharpened.

Some things stay with people, and should. Every posting. Noticing when a rule is wrong. New suppliers with no history. And the invoices that simply don't say what was bought. "I've seen a lot of strange invoices where nobody understands what we actually bought," says Arvid.

A pattern, not a one-off

Mads works on the technical side, with SAP AI Core. His main point is that this is about more than invoices.

"What we have built is not a special invoice solution. It is a pattern you can reuse in any SAP process. Whether it's an invoice, a customer email or something else coming in, it works the same way."

The invoice stays in its normal SAP process. In this case it was VIM in S/4HANA, but the solution works for any invoice process that runs in SAP. An app on SAP BTP runs alongside it, so the SAP core stays clean. And all contact with the language models goes through SAP AI Core, never directly.

That matters, because an invoice contains amounts, supplier details and sometimes personal names. With SAP AI Core and its Generative AI Hub, every AI call goes through the same door, where access and cost are managed in one place. Personal data can be masked before it reaches the model. Every call can be logged, so you can see what was sent, what came back and what it cost.

It also keeps the solution open for what comes next.

"If a new model comes out in six months or a year that you want to use, we can just switch to it. We don't need to rebuild anything."

With SAP AI Launchpad, the team can test prompts against invoices where the right answer is known, compare models and keep track of versions. "Instead of guessing what the right answer is, we can start measuring," says Mads.

What we learned along the way

The biggest lesson is that history is not the answer key. The postings in the system show what was registered, not always what was right. The same supplier may have been coded in two ways, with no explanation in the invoice text. That is why the written rules became the source of truth.

The second lesson is about where the time goes. "The most time-consuming part of the implementation is sitting down with Anna and finding out what we should actually have here," says Arvid. The rules are rarely in the system. They are in people's heads.

That goes for the hard cases too. We asked about invoices that need to be split across 15 or 20 cost centers. The answer was the same: "When you look at the invoice, you know where you want to put things. I want to get that out of you and into the rules."

How to get started

Pearl recommends three steps before going live:

  1. Clean up your master data. Chart of accounts, cost centers and suppliers. The AI is never better than what it works with.
  2. Start small. One company, one type of invoice. Build a test set of correctly coded invoices.
  3. Run in shadow mode. Let the AI suggest alongside your AP team, without affecting their work. Compare the results before you use it for real.

"Steps one and two are the most important, but also the hardest to get started with. That's where we can really help," says Mads.

What's next

Today, the solution suggests account and cost center for non-PO e-invoices. Next up are tax codes, for both overhead and purchase invoices. "Especially with triangular trade, or when you have several EU countries in and out, it can get complicated very quickly," says Arvid.

After that, the same pattern can help read free text and attachments, flag unusual amounts and summarise invoices for the person who approves them. And it does not have to stop at finance. Creating purchase orders is one example the team mentions.

The starting point stays the same. When Anna retires, her rules stay behind. And the next colleague starts with her knowledge, not a blank screen.

Want to see how it works? Get in touch with Pearl for a hands-on demo.