Connect on-premises SAP systems to Azure
Many manufacturers use on-premises SAP Enterprise Resource Planning (ERP) systems. Often, manufacturers connect SAP systems to Industrial IoT solutions, and use the connected system to retrieve data for manufacturing processes, customer orders, and inventory status. This article describes how to connect these SAP-based ERP systems.
Prerequisites
The following prerequisites are required to complete the SAP connection as described in this article.
- An Azure Industrial IoT solution deployed in an Azure subscription as described in Azure Industrial IoT reference architecture
IEC 62541 Open Platform Communications Unified Architecture (OPC UA)
This solution uses IEC 62541 Open Platform Communications (OPC) Unified Architecture (UA) for all Operational Technology (OT) data. This standard is described here.
Reference Solution Architecture
Components
For a list of components, refer to Azure Industrial IoT reference architecture.
Connect the reference solution to on-premises SAP Systems
The Azure services handling connectivity to your on-premises SAP systems is called Azure Logic Apps. Azure Logic Apps is a no-code Azure service to orchestrate workflows that can trigger actions.
Note
If you want to try out SAP connectivity before connecting your real SAP system, you can deploy an SAP S/4 HANA Fully-Activated Appliance
to Azure from here and use that instead.
Configure Azure Logic Apps to receive data from on-premises SAP systems
The Azure Logic Apps workflow is from your on-premises SAP system to Azure Logic Apps. It also stores the data sent from SAP in your Azure Storage Account. To create a new Azure Logic Apps workflow, follow these steps:
- Deploy an instance of Azure Logic Apps in the same region you picked during deployment of this reference solution via the Azure portal. Select the consumption-based version.
- From the Azure Logic App Designer, select the trigger template
When a HTTP request is received
. - Select
+ New step
, selectAzure File Storage
, and selectCreate file
. Give the connection a name and select the storage account name of the Azure Storage Account. ForFolder path
, entersap
, forFile name
enterIDoc.xml
and forFile content
selectBody
from the dynamic content. In the Azure portal, navigate to your storage account, selectStorage browser
, selectFile shares
>Add file share
. Entersap
for the name and selectCreate
. - Hover over the arrow between your trigger and your create file action, select the
+
button, then selectAdd a parallel branch
. SelectAzure Data Explorer
and add the actionRun KQL query
from the list of Azure Data Explorer (ADX) actions available. Specify the ADX instance (Cluster URL) name and database name of your Azure Data Explorer service instance. In the query field, enter.create table SAP (name:string, label:string)
. - Save your workflow.
- Select
Run Trigger
and wait for the run to complete. Verify that there are green check marks on all three components of your workflow. If you see any red exclamation marks, select the component for more information regarding the error.
Copy the HTTP GET URL
from your HTTP trigger in your workflow. You'll need it when configuring SAP in the next step.
Configure an on-premises SAP system to send data to Azure Logic Apps
Sign in to the SAP Windows Virtual Machine
Once at the Virtual Machine desktop, select on
SAP Logon
Select
Log On
in the top left corner of the appSign in with the
BPINST
user name, andWelcome1
passwordIn the top right corner, search for
SM59
. This should bring up theConfiguration of RFC Connections
screen.Select on
Edit
andCreate
at the top of the app.Enter
LOGICAPP
in theDestination
fieldFrom the
Connection Type
dropdown, selectHTTP Connection to external server
Select The green check at the bottom of the window.
In the
Description 1
box, putLOGICAPP
Select the
Technical Settings
tab and fill in theHost
field with theHTTP GET URL
from the logic app you copied (for example prod-51.northeurope.logic.azure.com). InPort
put443
. And inPath Prefix
enter the rest of theHTTP GET URL
starting with/workflows/...
Select the
Login & Security
tab.Scroll down to
Security Options
and setSSL
toActive
Select
Save
In the main app from step 5, search for
WE21
. This brings up thePorts in IDoc processing
.Select the
XML HTTP
folder and selectCreate
.In the
Port
field, inputLOGICAPP
In the
RFC destination
, selectLOGICAPP
.Select
Green Check
toSave
Create a partner profile for your Azure Logic App in your SAP system by entering
WE20
from the SAP system's search box, which will bring up thePartner profiles
screen.Expand the
Partner Profiles
folder and select thePartner Type LS
(Logical System) folder.Select on the
S4HCLNT100
partner profile.Select on the
Create Outbound Parameter
button below theOutbound
table.In the
Partner Profiles: Outbound Parameters
dialog, enterINTERNAL_ORDER
forMessage Type
. In theOutbound Options
tab, enterLOGICAPP
forReceiver port
. Select thePass IDoc Immediately
radio button. ForBasic type
enterINTERNAL_ORDER01
. Select theSave
button.
Testing your SAP to Azure Logic App Workflow
To try out your SAP to Azure Logic App workflow, follow these steps:
In the main app, search for
WE19
. This should bring up theTest Tool for IDoc Processing
screen.Select
Using message type
and enterINTERNAL_ORDER
Select
Create
at the top left corner of the screen.Select the
EDICC
field.A
Edit Control Record Fields
screen should open up.In the
Receiver
section:PORT
enterLOGICAPP
,Partner No.
enterS4HCLNT100
,Part. Type
enterLS
In the
Sender
section:PORT
enterSAPS4H
,Partner No.
enterS4HCLNT100
,Part. Type
enterLS
Select the green check at the bottom of the window.
Select
Standard Outbound Processing
tab at the top of the screen.In the
Outbound Processing of IDoc
dialog, select the green check button to start the IDoc message processing.Open the Storage browser of your Azure Storage Account, select Files shares and check that a new
IDoc.xml
file was created in thesap
folder.Note
To check for IDoc message processing errors, entering
WE09
from the SAP system's search box, select a time range and select theexecute
button. This brings up theIDoc Search for Business Content
screen and you can select each IDoc for processing errors in the table displayed.
Microsoft on-premises Data Gateway
Microsoft provides an on-premises data gateway for sending data to on-premises SAP systems from Azure Logic Apps.
Note
To receive data from on-premises SAP systems to Azure Logic Apps in the cloud, the SAP connector and on-premises data gateway are not required.
To install the on-premises data gateway, complete the following steps:
Download and install the on-premises data gateway from here. Pay special attention to the prerequisites! For example, if your Azure account has access to more than one Azure subscription, you need to use a different Azure account to install the gateway and to create the accompanying on-premises data gateway Azure resource. If so, create a new user in your Azure Active Directory.
If not already installed, download and install the Visual Studio 2010 (Visual C++ 10.0) redistributable files from here.
Download and install the SAP Connector for Microsoft .NET 3.0 for Windows x64 from here. SAP download access for the SAP portal is required. Contact SAP support if you don't have this.
Copy the four libraries libicudecnumber.dll, rscp4n.dll, sapnco.dll, and sapnco_utils.dll from the SAP Connector's installation location (by default this is
C:\Program Files\SAP\SAP_DotNetConnector3_Net40_x64
) to the installation location of the data gateway (by default this isC:\Program Files\On-premises data gateway
).Restart the data gateway through the
On-premises data gateway
configuration tool that came with the on-premises data gateway installer package installed earlier.Create the on-premises data gateway Azure resource in the same Azure region as selected during the data gateway installation in the previous step and select the name of your data gateway under
Installation Name
.You can access more details about the configuration steps here.
Note
If you run into errors with the Data Gateway or the SAP Connector, you can enable debug tracing by following these steps.