← All posts

Agentic AI for SAP

Why an AI Agent Should Read Your SAP System Before Drafting Forms

Why an AI Agent Should Read Your SAP System Before Drafting Forms

If a fact isn't in the system, it doesn't go in the form. That one rule separates a trustworthy forms migration from a risky one, and it sits at the heart of our SAP AI Solutions work. Teams moving legacy output to Adobe Forms often hand the job to an AI agent that looks at a PDF and guesses the fonts, field types and layout logic. The result looks right on one document and breaks on the next. At 2iSolutions US, we argue for a different order of work: the agent reads SAP first, then drafts, then checks every element against what it read.

Why does an AI agent need to read SAP before it drafts?

An AI agent should read SAP first because the system holds the facts a form depends on: data fields, types, lengths, text modules, conditions and output logic. Drafting from a picture of a document forces guesses. Drafting from system facts removes them, so the form matches reality.

Think about what a form really is. Smart Form or SAPscript output is a layer of presentation sitting on top of data structures, program logic and configuration. The visible page shows only a fraction of that.

Consider a scanned sample invoice. It cannot tell you that a field holds a currency amount with two decimals in one company code and zero in another. It cannot show the conditional window that prints only for export orders. It cannot reveal the text module that pulls a legal footer by language.

An agent that sees only the sample will invent answers for those gaps. An agent that reads the system will not need to.

What "reading SAP" actually covers

Reading SAP means querying the source objects directly instead of inferring them from output. A Smart Form is a legacy SAP document layout tool that combines a graphical form builder with ABAP logic. SAPscript is the older text-based layout technology that predates it. Both store their rules in the system.

A proper read pulls these items:

  • Form definitions, including windows, pages and node structures
  • Interface parameters and the data types behind each field
  • Style definitions, covering fonts, paragraph formats and character formats
  • Text modules and the conditions that trigger them
  • Driver program logic that calls the form
  • Output determination settings tied to each document type

None of that needs interpretation. It is recorded fact, and the agent reads it the way a consultant would open the form in the Form Builder.

What goes wrong when an agent guesses?

When an agent guesses, it fills gaps with plausible defaults, and plausible is not correct. Guessed fonts drift from the style definition, guessed field types break on edge-case data, and guessed conditions drop content. The failures hide until a document with unusual data reaches production.

Here is a concrete scenario. A finance team migrates a customer statement. The agent studies three sample PDFs, sees a right-aligned number column, and assigns it a numeric field type. That works for all three samples.

Then a statement arrives with a negative balance shown with a trailing minus sign. The guessed field type rejects it. The form either throws an error or prints a blank where the balance should sit.

Three common guess failures

Teams see the same patterns again and again.

  1. Style drift. The agent picks a font that looks close. The SAP style says otherwise, so printed output differs from the approved corporate template.
  2. Field type mismatch. The agent treats a character field as a number, or the reverse. Leading zeros vanish from part numbers and the document becomes wrong.
  3. Missing conditions. A window prints only when a flag is set. The sample never triggered it, so the agent never builds it.

Each failure has one cause. The agent had no access to the fact, so it filled the space with an assumption. You can read more about this risk in the 2iSolutions blog on whether Smart Forms to Adobe Forms output will match.

Why the errors surface so late

Guess-based drafts pass review because reviewers compare them with the same samples the agent saw. The form looks identical, so everyone signs off. Nobody tests the odd cases because nobody knows they exist.

Production exposes them. A customer in another country, a credit memo, a rush order with a special text: each one pulls a path the sample never showed. Then the support queue fills, and the team spends weeks patching a form that should have been right at launch.

How does the read-first workflow run?

A read-first workflow has three stages: extract facts from SAP, draft the Adobe form from those facts, and verify every element against the extracted record. Each stage produces a checkable artifact, so reviewers can trace any field back to its source object in the system.

Here is the sequence in practice:

  1. Extract. The agent reads the form definition, interface, styles, text modules and driver program. It writes a structured inventory of every field, condition and style.
  2. Map. The agent links each source element to its Adobe Forms counterpart. A Smart Form window becomes a subform, and a node condition becomes a script or binding rule.
  3. Draft. The agent builds the layout using the mapped elements and the real style values, not approximations.
  4. Verify. The agent compares the draft against the inventory. Any element without a source fact gets flagged instead of invented.
  5. Review. A consultant checks the flags, resolves open questions and approves the form.

The flag step matters most. A guessing agent hides its uncertainty. A reading agent shows exactly where the system gave no answer, so a human decides.

Where the human consultant fits

The agent does not replace the consultant. It does the tedious lookup work, so the consultant spends time on judgment calls. For example, a legacy form may carry a workaround nobody needs anymore. Only a person who knows the business can say whether to carry it forward or drop it.

That split is where good SAP Consulting Services USA earn their keep. The consultant owns decisions, and the agent owns accuracy of transcription.

What facts should the agent pull from the system?

The agent should pull every fact the form depends on, grouped into data, layout, logic and output settings. Data facts cover field types and lengths. Layout facts cover styles and page structure. Logic facts cover conditions. Output facts cover how the document gets triggered and sent.

Data facts

Data facts decide whether a field accepts real values. The agent reads the interface to learn each parameter's type, length, decimals and conversion exit. A conversion exit is a routine that changes how a value displays, such as adding leading zeros to a material number.

Missing a conversion exit is a classic error. The stored value and the printed value differ, and a guessing agent only ever sees the printed one.

Layout facts

Layout facts live in styles and page definitions. Paragraph formats hold font family, size, spacing and alignment. Character formats hold bold, italic and color. Page nodes hold the follow-on page logic that decides what happens when a table runs long.

An agent that reads these values copies them exactly. One that eyeballs a PDF gets close and misses by a point size, which a brand team will notice immediately.

Logic and output facts

Logic facts include every condition on every node, plus calls to routines in the driver program. Output facts include output types, partner functions, languages and print or email settings. This kind of structured map of business objects and their relationships is the idea behind SAP knowledge graph for enterprise AI, which gives agents context beyond raw tables.

Consider a delivery note that prints in German for one plant and English for another. The language logic sits in output determination, not on the page. Only a system read finds it.

How do you test an agent-drafted form?

You test an agent-drafted form by running real documents through both the old and new versions and comparing the results field by field. Use production-like data that covers edge cases, not just clean samples. Any difference gets traced to a source object and either fixed or accepted.

A solid test set includes:

  • A standard document with typical data
  • A document with zero and negative values
  • A document in each supported language
  • A document with the longest text values the system allows
  • A document that triggers every conditional window
  • A multi-page document that tests page breaks

Because the agent kept a source inventory, each test failure points straight to its cause. You do not hunt through the form. You open the inventory entry, read the source fact and see where the draft diverged.

Regression after go-live

Forms change after launch. A new legal footer, a tax rule update or a new output channel can all touch the layout. The inventory stays useful here, since the agent can re-read SAP and flag what changed since the last extract.

That turns form maintenance from a hunt into a diff. Teams that pair this with SAP Support Services can catch drift before customers see it.

Where does this fit in a wider AI strategy?

Read-first drafting fits as one controlled use of AI inside an SAP program: the agent works from verified system data and a human approves the output. The same principle applies to reports, interfaces and data cleansing, so teams build one repeatable pattern instead of several risky ones.

Plenty of organizations run AI pilots that produce impressive demos and unreliable results. The cause is usually the same. The model works from a description of the system instead of the system itself.

Grounding fixes that. When an agent reads authoritative sources, its answers carry a trail. When it does not, you get fluent output nobody can audit. For regulated documents such as invoices and customer statements, auditability is not optional.

Our work on SAP AI Solutions follows this rule across use cases. The agent reads, cites its source and flags gaps. People decide what to do with the gaps.

Connecting agents to the system safely

Safe access matters as much as good prompts. The agent needs read-only access scoped to the objects it must inspect, with a clear log of what it queried. Teams planning SAP AI Integration should settle authorizations, data privacy and transport handling before the first extraction run.

For background on where the platform is heading, SAP's own S/4HANA product overview explains the core system many of these forms depend on.

How should you prepare your forms migration?

Prepare by inventorying your forms, ranking them by business risk, and piloting the read-first workflow on one mid-complexity document before scaling. A pilot shows how clean your system data really is, and it surfaces access and governance questions while the stakes stay low.

Start with these steps:

  1. List every Smart Form and SAPscript form in use, with the output types that trigger each.
  2. Rank them by volume and regulatory exposure. Invoices and customs documents come first.
  3. Pick one form with moderate complexity, such as a delivery note with a few conditions.
  4. Run the extract, map, draft and verify stages, then compare output against production.
  5. Record what the flags revealed and adjust your process before the next batch.

Expect surprises. Old forms often carry dead code, duplicate text modules and conditions nobody remembers writing. Finding them early is a benefit, since you decide what to retire instead of copying clutter into a new format.

Teams that treat the pilot as a learning exercise tend to move faster in later waves. They know their data quality, their review bottlenecks and their true effort per form.

What a reliable forms migration looks like in practice

A reliable forms migration starts with facts and ends with proof. The agent reads Smart Forms and SAPscript objects from the system, drafts Adobe Forms from what it finds, and flags anything the system cannot answer. Consultants then resolve the flags and approve the result.

The payoff shows up after go-live. Fewer surprise failures reach production, support tickets drop, and every field has a traceable source. When a rule changes, you re-read the system and compare, instead of reverse-engineering a PDF again.

2iSolutions US builds this read-first approach into its forms and AI work, pairing agent speed with consultant judgment. If your migration plan still relies on an agent looking at screenshots, the first fix is simple: point it at the system.

Frequently Asked Questions

Q. Why can't an AI agent just copy the layout from a PDF?

A. A PDF shows one rendered result, not the logic behind it. Conditions, conversion exits, language rules and style definitions stay hidden, so the agent guesses and breaks on data the sample never showed.

Q. What does it mean for an agent to read an SAP system?

A. It means the agent queries form definitions, interfaces, styles, text modules and driver programs directly, with read-only access. It records those facts in an inventory and builds the new form from that record.

Q. Does the consultant still have a role if the agent reads the system?

A. Yes. The agent handles lookup and transcription, while the consultant decides which legacy behavior to keep, change or retire. 2iSolutions US pairs the two so speed does not cost accuracy.

Q. How do you catch errors before go-live?

A. Run real documents through the old and new forms and compare them field by field. Include negative values, every language and every conditional window, then trace each difference to a source object.

Q. Which forms should we migrate first?

A. Start with high-volume or regulated documents such as invoices and customs forms, but pilot on one mid-complexity form first. The pilot exposes data quality and access issues before you scale.

Watch the pipeline run live on December 2: Link

Take this further

Put this to work on your own SAP estate

Everything described above is something we deliver, with an SAP architect reviewing every change an agent makes.

Book an AI landscape assessment

Want this applied to your SAP estate?

Tell us where you are and we'll come back with a concrete next step.

Talk to our team