The main goal for creating business documents in SAP ESM is to help agents identify and further process back-end records easily and more efficiently, while working on assigned Cases. Agents often receive inquiries via emails, and in some scenarios, they get documents attached, like payment advice, invoice or purchase order. Creating business documents, for these types of attachments, to display information in a structured manner consists of multiple steps. The first is to define the business document, with its document ID, name and language. Next, as an Administrator, you have the option to choose from different input options which will allow the Agents to maintain the business document within the Case while handling the inquiries. The available options are: manual data entry, document extraction, and business information extraction* (*only available with SAP AI Units). You will learn in more detail how each option works and how it can be configured.
Let’s start now by creating a business document.
Creating a Business Document
To create a business document, choose the (+) symbol and select ‘Create New Business Document’, fill in the necessary details, and save your work.

Your newly created business document will then be displayed in the Business Documents list, with the header information visible on the right-hand side. A draft version of the business document will be listed in the Versions table.

On the right-hand side, under Action use the three dots (...) symbol to ‘Activate’ the version, or ‘Copy to New Business Document’.
To open the business document designer, choose the symbol below ‘Version’.

Note
Only one draft version is allowed to be edited at any given time.
To perform the configuration of a business document, there are three features which must be maintained, and these are available in three different tabs within the Business Document settings:
- Tab 1: Designer
- Tab 2: Actions
- Tab 3: Input Options
In the following sections, you will be guided through the scope of each tab.
Configuring a Business Document - Using the Designer Tab
The objective of the Designer Tab is to identify which fields and field properties are required for creating the business document. Imagine for example that you want to create an Invoice by extracting data from a PDF document attached to a Case in SAP ESM. You as an Administrator can define here the structure of the business document required for processing an Invoice in the back end.
In the Designer tab, choose + to add controls and fields to the business document table. The elements you add will appear as columns within the table. Some elements like "dropdown" allow you to add a dynamic data source, which will be covered at a later point. The elements "source" and "status" are default and cannot be removed. Each element will have its associated properties displayed on the right side of the screen alongside the business document layout. The properties may differ depending on the element in question. The current text element has among its properties "display id", "initial value", "description", "minimum" and "maximum" character limit.

Elements can have different conditions. They can be set to "required", "hidden", "read only" or be defined as the main navigation column. By selecting the gear icon next to a condition, it would be possible to implement a rule based on which an element condition would take place. An example would be a field becoming "required" or "optional" when a specific country has been selected.

The rules can be defined in the Condition Block that will appear after selecting the gear icon.

A property can be deleted by selecting the ‘Delete’ icon in the menu next to the element title or in the property section of the element.

Configuring a Business Document - Using the Actions Tab
The objective of the Actions tab is to define Actions which are capable of initiating API calls to external systems via SAP Cloud Integration, enhancing the adaptability and effectiveness of business documents.
Under the ‘Actions’ tab it is possible to set API URLs for business document actions to send or retrieve data or validate data from external systems.
- Create Action: To create an action, choose the plus icon next to ‘Configure Actions’. This will open up a new window. In there, add an action text, a description as well as select the action type. The action type can be "custom", "post" or "lookup". When selecting the "post" action an arrow will be displayed at this location in the business document. When selecting the "lookup" action, a magnifying glass will be visible. After a business document is posted, the business document is set to read only.

- Apply Action to: Choose whether to apply to:
- Single Business Document
- Single and Multiple Business Documents
- Multiple Business Documents Only
This selection lets you choose either to apply the action to multiple business documents simultaneously or restrict it to a single business document.
![The Actions tab of the Business Document Designer in ESM is displayed. Under Configure Actions, options such as View Extraction Results, Extract From Attachment, and Post are listed, with Post highlighted. On the right, the Action Properties panel is shown, with fields like Display ID, Button Text, and Description. The Action Type field is set to Post. At the bottom, a segmented selection labeled Apply action to provides options: Single Business Document, Single or Multiple Business Documents, and Multiple Business Documents Only. An arrow points to this section.] The Actions tab of the Business Document Designer in ESM is displayed. Under Configure Actions, options such as View Extraction Results, Extract From Attachment, and Post are listed, with Post highlighted. On the right, the Action Properties panel is shown, with fields like Display ID, Button Text, and Description. The Action Type field is set to Post. At the bottom, a segmented selection labeled Apply action to provides options: Single Business Document, Single or Multiple Business Documents, and Multiple Business Documents Only. An arrow points to this section.]](https://learning.sap.com/service/media/topic/d976a98e-f839-4c32-828a-595d0cbe98d3/C4H57I_2504_en-US_media/C4H57I_2504_en-US_images/U5L2_9.png)
- Add Integration: Choose "Add Integration" within the Integration section.
![The Actions configuration screen in ESM is displayed. The left panel lists View Extraction Results, Extract from Attachment, and New Button, with New Button highlighted. On the right, the Action Type is set to Post, and options for Apply action to are available with radio buttons for Single Business Document, Single or Multiple Business Documents, Multiple Business Documents Only, and All Business Documents. Below, a section for Business Documents to Send provides a choice between Selected Business Documents Only and All Business Documents, with an informational note about attachments. An arrow points to the Add Integration button, which is followed by an Add Automation button. At the bottom, checkboxes for Hidden and Deactivated are available, and Save and Cancel buttons are visible in the bottom-right corner.] The Actions configuration screen in ESM is displayed. The left panel lists View Extraction Results, Extract from Attachment, and New Button, with New Button highlighted. On the right, the Action Type is set to Post, and options for Apply action to are available with radio buttons for Single Business Document, Single or Multiple Business Documents, Multiple Business Documents Only, and All Business Documents. Below, a section for Business Documents to Send provides a choice between Selected Business Documents Only and All Business Documents, with an informational note about attachments. An arrow points to the Add Integration button, which is followed by an Add Automation button. At the bottom, checkboxes for Hidden and Deactivated are available, and Save and Cancel buttons are visible in the bottom-right corner.]](https://learning.sap.com/service/media/topic/d976a98e-f839-4c32-828a-595d0cbe98d3/C4H57I_2504_en-US_media/C4H57I_2504_en-US_images/U5L2_10.png)
- Select HTTP Data: Choose the relevant HTTP data from the outbound configuration set up in the ‘Business Document Integration’ section. Decide on the data you wish to send with the API as the iFlow Input, selecting from options such as case, user, or business document fields.
- Download Request JSON Schema: Select "Download Request JSON Schema" to download the schema file in JSON format, which can then be uploaded to SAP Cloud Integration when creating a message mapping for the API request. Choose the business document fields you want to update with the API response data as the iFlow Output.
- Download Response JSON Schema: Select "Download Response JSON Schema" to download the response schema file in JSON format, which can then be uploaded to SAP Cloud Integration for creating a message mapping for the API response.

- Save iFlow Configuration: Save the iFlow configuration settings.
- Add Integration Automation: To enable automatic execution of this action when specific conditions are met, select "Add Integration Automation" in the Automation section. Set up rule conditions that will trigger the action to be performed automatically.

- Configuration Section: In the Configuration section, you can hide or deactivate the action using the available options. Check the box to have the action hidden or deactivated by default. To establish conditions for visibility or deactivation, select (gear icon) Configure rule, which allows you to set rules governing when the action is visible or appears as deactivated. For example, mark the Hidden flag if you want to always hide an action (the same principle applies to the Deactivated flag). Alternatively, if you want to hide or deactivate a specified action only under certain conditions, select the gear icon and maintain the required logic.

Making an action Visible (or Hidden) under a certain condition can be achieved by creating a Rule configuration as shown in the following image: simply select the control you want to activate (Hidden or Visible) and then enter the logic in the condition block. Select the Save button when finished.

Configuring a Business Document – Using the Input Options Tab
The objective of the Input Options tab is to choose one or more input methods for the business document. Agents will be able to leverage the defined methods while working on the assigned cases.
There are three input options:
- Manual Entry: as an administrator you can add elements from your business document layout that you want to display for manual data entry by using a quick create form. You can also reorder the elements as desired.
- Document Extraction: as an administrator you can choose a schema and type of files from which to extract data.
- Business Information Extraction: as an administrator you can use the generative AI-based information extraction capability to extract business information from the subject or description of the case and add that information to the business document table.
Manual Entry
Manual Entry is used for fields that are supposed to be maintained manually by an agent.

Document Extraction
Schemas specify what information to extract from attachments and how that information maps to business document header and line-item fields. As an administrator you can use different schemas for different business document scenarios.
SAP ships standard schemas that you can use as-is or copy and modify for your specific needs. You can also create new schemas for additional scenarios. The standard schemas are:
- Invoice
- Payment advice
- Purchase order
‘Document Extraction’ allows you to select a previously created business document schema and define what file types should be extracted in this schema. In the next image, a PDF type of file has been selected. The extraction can be executed manually or automatically, when the related checkbox is ticked. A confidence score can also be displayed next to each extracted data when the related checkbox is ticked.
As an administrator, after selecting the schema and the type of file, you must perform the Field Mappings: it is necessary to map each business document fields to the respective header field from the selected schema: on the right-hand side the header and line item fields defined in the document schema can be selected and on the left-hand side the fields created under the designer tab are visible.

Once the field mapping has been completed, you can define how the extraction should be executed. As mentioned previously, you can select the manual or the automated option, and if you choose the second one, you can also define the condition that should be relevant for such option, as shown in the next image, for the business document Payment Advice. The business logic must be entered in the Condition Block.



