Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
xiao_zhao1
Advisor
Advisor
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)



  1. Log on to the SAP BTP cockpit.

  2. 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.

  1. 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)



  1. Call up transaction ISLM_CONN_MAP and choose Create Connection.

  2. Choose intelligent scenario SO_AUTO_EXTRACTION. Click Next.





  1. 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.





  1. Choose Connection Check. After the check, the connection status should become Ready. Then click Save.




If the connection status is "Error", please refer to section 3.1 Connection Issue for troubleshooting.

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



  1. Call up transaction SPRO and display SAP Reference IMG.

  2. Choose ABAP Platform > Application Server > Basis Services > Intelligent Scenario Lifecycle Management > Service Connections for Machine Learning Infrastructure > Create Connection to remote machine learning provider.





  1. 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



  1. 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





  1. Click OK.

  2. 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



  1. Call up transaction SPRO and display SAP Reference IMG.

  2. Choose ABAP Platform > Application Server > Basis Services > Intelligent Scenario Lifecycle Management > Service Connections for Machine Learning Infrastructure > Maintain Connection for an Intelligent Scenario.





  1. 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





  1. Save the settings.


A job starts to create an intelligent scenario version. It takes less than 30 minutes.

If you encounter any connection issues, please refer to section 3.1 Connection Issue for troubleshooting.

2.3 Activating Intelligent Scenario (Fiori App in SAP S/4HANA)


 

  1. 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.

  2. Choose scenario type SAP Document Information Extraction.

  3. Choose intelligent scenario SO_AUTO_EXTRACTION.





  1. 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).

3 Troubleshooting for System Setup


3.1 Connection Issue


3.1.1 Check ISLM connection


Call up transaction islm_conn_map (Maintenance of ISLM Connection Mapping). You should see an entry in the table for Intelligent Scenario SO_AUTO_EXTRACTION.


Select the entry and click “Check Connection”. The connection status should be “Ready”.


If the connection status is “Error”, go on to check the RFC connection and oAuth 2.0 configuration.

3.1.2 Check RFC connection


The RFC destination ID exists in the ISLM connection mapping table. Call up transaction SM59, and locate the connection with type “G”. Click “Connection Test”. The HTTP Response Status should be 200.


If not, check whether the host maintained in the connection is accessible. To do so, put the host info and Path Prefix info together and add “health” at the end to get a URL. Ping the URL in the browser.

Example:

In above window, the URL should be aiservices-dox.cfapps.sap.hana.ondemand.com/document-information-extraction/v1/health.

Ping the URL, and you should see the successful message “The DOX service is healthy!”


If an error message appears, the data extraction service is unavailable. Check the troubleshooting guide for the service (Getting Support | SAP Help Portal).

If the service is okay, go back the RFC connection to make sure the SSL is active for this connection.


If the preceding settings are good but the connection test still fails, you need to think about the proxy, firewall and certification settings, which may prevent your system from accessing the service host of the data extraction service.

If a proxy is needed, maintain proxy settings as indicated below.


If your system has a firewall, add the data extraction service to whitelist, and import the certification of the service via transaction code STRUST.



3.1.3 Check oAuth 2.0 Configuration


If the RFC connection test is passed but ISLM connection does not work, you need to find the oAuth 2.0 configuration name in ISLM connection mapping table and call up transaction OA2C_Config to do further checks.

Locate the configuration for profile S4_DOX_SOR.


If your system has a firewall, add it to the configuration.


And similarly, make sure your system can access the token endpoint. Usually, this endpoint is different from the host in the RFC connection. Add the endpoint to the whitelist if your system has a firewall. Then import the certification for it via transaction code STRUST. Your system will use the endpoint to get the token.



3.2 Other Issues


3.2.1 Missing Number Range


Sales order request is a new business object. If the upload fails due to a missing number range, call up transaction SNRO and edit the interval for SDSLS_SOR.



3.2.2 Virus Scan


If the upload is prevented by virus scan not active, implement Note 3264933 -- File Wrongly Detected as a Virus in App Create Sales Orders - Automatic Extraction.

3.2.3 Upload limitation for trail account


If the connection suddenly cannot work as usual and you are using a trail account, the upload limit of the data extraction service may be exceeded. See Service Plans | SAP Help Portal for more details.

If your issue persists, please raise your issue to component SD-SLS-IMP-DOX to get further support.

 

You can find more updated detail in below blog collection: