In this blog, you can learn how to set up communication between SAP S/4HANA (OP/PCE) and SAP BTP Document Information Extraction. This communication is the prerequisite for using the Create Sales Order-Automatic Extraction (F4920) app.
1 Preparation
- Make sure that you have an SAP BTP global account to access the SAP BTP cockpit. For more information, see Setting Up a Global Account.
- Make sure that you have enabled the Document Information Extraction service using the SAP BTP cockpit. A separate license may be required. For more information, see Initial Setup.
You can refer to example tutorial Use Trial to Create a Service Instance for Document Information Extraction to check your account and set up the service instance.
2 Procedure for System Setup
2.1 Creating Service Key (SAP BTP Cockpit)
- Log on to the SAP BTP cockpit.
- Create a service instance.
- Choose Services -> Services Marketplace -> Document Information Extraction -> Create.
- Follow the instructions in the wizard to create a service instance.
In the dialog, choose your service plan. Enter a name for your new instance, for example, doc-info-extraction-inst and click Create Instance.
In the following dialog, click on View Instance to navigate to the list of your service instances.
You have successfully created a service instance for Document Information Extraction.
- Create a service key.
- Choose Services -> Instances and Subscriptions
- Select the service instance and choose Create Service Key.
In the dialog, enter a name for your service key, for example, doc-info-extraction-key. Click Create to create the service key.
You have successfully created a service key for your service instance. You can now view the service key in the browser or download it. Keep the service key data for later use.
2.2 Creating Connection Mapping to Intelligent Scenario in SAP S/4HANA (Backend Settings)
For different SAP S/4HANA releases, different configuration steps are required:
- For release 2022 FPS01 and later, 2021 SPS04 and later, please refer to step 2.2.1.
- For release 2022, 2021 FPS01/FPS02/SPS03, please refer to step 2.2.2.
2.2.1 Creating Connection Mapping to Intelligent Scenario (for 2022 FPS01 and later, 2021 SPS04 and later)
- Call up transaction ISLM_CONN_MAP and choose Create Connection.
- Choose intelligent scenario SO_AUTO_EXTRACTION. Click Next.
- In the dialog, enter the following information and click Next.
- OAuth 2.0 client profile: S4_DOX_SOR
- Service Key: Paste the service key created in step 2.1.
- Choose Connection Check. After the check, the connection status should become Ready. Then click Save.
2.2.2 Creating Service Connection, OAuth 2.0 Client and Mapping Connection to Intelligent Scenario (for 2022, 2021 FPS01/FPS02/SPS03)
2.2.2.1 Creating Service Connection
- Call up transaction SPRO and display SAP Reference IMG.
- Choose ABAP Platform > Application Server > Basis Services > Intelligent Scenario Lifecycle Management > Service Connections for Machine Learning Infrastructure > Create Connection to remote machine learning provider.
- Create a destination for document processing.
General settings:
- Connection type: G (HTTP connection to external server)
- RFC destination: Enter a destination description.
Technical settings:
- Host: url value (outside the uaa section) from the service key (without the leading https://)
- Port: Port of the host server
- Path prefix: /document-information-extraction/v1/
Logon & Security settings:
- Logon with user: Do not use a user
- SSL: Active
- SSL Certificate: Choose your SSL certificate from the list.
Depending on your system configuration, you may also need to set other logon & security attributes as well as HTTP proxy options.
2.2.2.2 Creating OAuth 2.0 Client
- Call up transaction OA2C_CONFIG and create an OAuth 2.0 client.
- OAuth 2.0 client profile: S4_DOX_SOR
- Configuration name: Enter a name for the client Configuration
- OAuth 2.0 client ID: clientid value from the service key
- Click OK.
- Make the following settings.
General settings:
- Client secret: clientsecret value from the service key
Authorization server settings:
- Authorization endpoint: url value (inside the uaa section) from the service key, followed by “/oauth/token/ authorize”. (Example: yourendpoint.authentication.sap.hana.ondemand.com/oauth/token/authorize)
- Token endpoint: url value (inside the uaa section) from the service key, followed by “/oauth/token”. (Example:yourendpoint.authentication.sap.hana.ondemand.com/oauth/token)
Access settings
- Client authorization: Basic
- Resource access authentication: Header Field
- Selected grant type: Client Credentials
2.2.2.3 Mapping Connection to Intelligent Scenario
- Call up transaction SPRO and display SAP Reference IMG.
- Choose ABAP Platform > Application Server > Basis Services > Intelligent Scenario Lifecycle Management > Service Connections for Machine Learning Infrastructure > Maintain Connection for an Intelligent Scenario.
- Switch to the change mode. Insert a row and make the following settings:
- Intelligent scenario name: SO_AUTO_EXTRACTION
- Connection information: RFC destination created in step 2.2.2.1
- OAuth 2.0 client profile: S4_DOX_SOR
- OAuth 2.0 client configuration: Configuration name created in step 2.2.2.2
- Save the settings.
A job starts to create an intelligent scenario version. It takes less than 30 minutes.
2.3 Activating Intelligent Scenario (Fiori App in SAP S/4HANA)
- On the Fiori launchpad, open the Intelligent Scenario Management app, The business role template SAP_BR_ANALYTICS_SPECIALIST must have been added to your user.
- Choose scenario type SAP Document Information Extraction.
- Choose intelligent scenario SO_AUTO_EXTRACTION.
- Choose the default version. On the Deployments tab of the new version pane, select the default deployment item and choose Activate -> For All.
If no version data is displayed, please wait a while for completion of automatic version creation (a background job).
You can find more updated detail in below blog collection:
- Create Sales Orders – Automatic Extraction (I): Introduction
- Create Sales Orders – Automatic Extraction (II): One-Click Setup for SAP S/4HANA Cloud
- Create Sales Orders – Automatic Extraction (III): App-Specific Configurations
- Create Sales Orders – Automatic Extraction (IV): Custom Proposal for Sales Order Request Fields (Using BAdI)
- Create Sales Orders – Automatic Extraction (V): Situation Handling
- Create Sales Orders – Automatic Extraction (VI): Intelligent RPA Bot – Version 1
- Create Sales Orders – Automatic Extraction (VII): Intelligent RPA Bot – Version 2
- Create Sales Orders – Automatic Extraction (Ⅷ): Compare Extracted Data with Original File via Side-by-Side View