Artificial Intelligence Blogs Posts
cancel
Showing results for 
Search instead for 
Did you mean: 

Large enterprises rarely process documents in a single legal entity. Accounts payable teams handle supplier invoices across dozens of company codes. HR shared services process onboarding documents for employees across multiple subsidiaries. Quality management teams receive certificates and inspection reports addressed to different plants. Procurement teams handle order confirmations sent to different buying entities.

In all of these scenarios, the same challenge comes up early: how do you configure SAP Document AI to handle multiple company codes or legal entities cleanly? The document type is the same across entities. The fields you want to extract are the same. But the legal entity matters for routing, authorization, and downstream ERP posting.

This post walks through a clean architecture for managing multiple company codes in SAP Document AI, and then goes further by using the workflow engine to inject organizational context that the document itself cannot provide.

The configuration steps in this post are based on the SAP Document AI Workspace UI.

The Architecture: One Schema, Context Injected by the Channel

SAP Document AI separates where a document comes from (the inbound channel) from how it is processed (the schema and workflow). That separation is the foundation of a clean multi-entity setup.

Here is what it looks like:

One schema per document type. Add company code as an input field in the schema. Input fields have their value injected at upload time, never extracted from the document. They can also be set to hidden so they do not appear in the reviewer UI at all, keeping the review screen clean while still carrying the value for routing and downstream processing.

One inbound channel per company code. This assumes each company code has a dedicated inbound mailbox or monitored folder. If that is already in place, each channel maps cleanly to one legal entity and becomes the authoritative source of the organizational context.

Company code injected as an input entity at upload time. Each channel is configured with a fixed input value: 1010 for one channel, 2020 for another. The value is set once per channel and injected automatically on every document that arrives. This is not extracted from the document content. It is asserted by the intake channel, which is the authoritative source.

Authorization separation via AMS restriction policies. In the Identity Authentication Service (IAS), restriction policies scope document visibility to the input entity value. Users in the 1010 team are scoped to documents carrying companyCode = 1010. The separation is enforced at the platform level, not by keeping schemas in separate buckets.

As the organization grows, onboarding a new company code means adding a channel with its fixed value.


How to Configure It

Step 1: Define the input field in your schema

In Schema UI, add a field for company code (or plant code, subsidiary, or whichever organizational identifier you need). Set the field type to String and place it in the appropriate group.

Once added, open Edit Settings for the field. There are four settings to configure:

  • Processor Type: Input — the value is injected at upload time, not read from the document.
  • Mandatory: Yes — ensures the field cannot be empty. The channel must always supply a value.
  • Read Only: Yes — prevents reviewers from overwriting the injected value in the UI.
  • Hide in Prediction: Yes — hides the field from the reviewer screen entirely; it carries its value silently for downstream use.
  • Authorization Relevant: Yes — marks this field as the basis for document-level access control via IAS restriction policies.

blog_cc_schema.png
All five settings configured for a company code input field.

Click Save, then Activate the schema version.

Step 2: Set the fixed value per channel

In the channel configuration, go to step 4 (Input Parameter). You will see all input fields from the schema listed. Enter the fixed value for this channel: e.g. 1010 for one company code, 2020 for another. Same schema, different value per channel.

blog_cc_channel.png

Step 3: Repeat per channel

Create one channel per company code. Each channel gets its own fixed input value. The schema and workflow stay unchanged.

Step 4: Configure authorization in IAS

In the Identity Authentication Service, define restriction policies that scope document visibility to the input entity value. Users assigned to the 1010 AP team receive a policy that limits their document access to documents carrying companyCode = 1010. This replaces the authorization separation that would otherwise require separate schemas or separate tenants.


Going Further: Injecting Plant Code from the Sender Address

A dedicated channel per company code works well when email routing is already in place. But some organizational context cannot be resolved from the channel alone. A condition node in the workflow can inspect the sender address and inject additional values as input entities.

SAP.EmailUtils.getFrom(fileId).getAddress()

A condition node branches on this value:

This works because the sender-to-plant mapping is a business rule your organization might already maintain. 


Putting It Together: The Multi-Entity Workflow

A production-grade multi-entity workflow combining these patterns looks like this:

  1. Document arrives via entity-specific inbound channel. Channel injects companyCode as input entity.
  2. Email Split node separates body and attachments.
  3. For-Each loop iterates over relevant attachments.
  4. Sender address condition: match sender against known supplier-to-plant mappings. Inject plantCode, costCenter, or subsidiary as input entity.
  5. Extraction node: runs against the shared schema. By the time extraction runs, the organizational context is already in the document. SAP Document AI extracts what only the document can provide: numbers, dates, line items, amounts, names.
  6. Confidence condition: route to auto-confirm or review queue.
  7. Outbound notification: deliver to SAP Integration Suite or downstream system with a fully enriched document.

What You Gain

This architecture gives you:

  • One schema to maintain regardless of how many legal entities, plants, or subsidiaries you onboard
  • Higher data quality on organizational fields because they come from controlled, authoritative sources rather than OCR interpretation
  • Authorization enforced at the platform level via IAS restriction policies, not by structural separation of schemas or tenants
1 Comment
Labels in this area