Using Logic App Standard to connect to SAP
Published Mar 13 2023 07:37 PM 5,180 Views
Microsoft

1. Overview:

SAP Connector (icon.png) is a Enterprise connector which provides a set of actions and triggers to connect to your SAP Service. Ref: SAP - Connectors | Microsoft Learn

The SAP connector supports the following message and data integration types from SAP NetWeaver-based systems:

  • Intermediate Document (IDoc)

  • Business Application Programming Interface (BAPI)

  • Remote Function Call (RFC) and Transactional RFC (tRFC)

The SAP connector uses the SAP .NET Connector (NCo) library.

To use the available SAP trigger and SAP actions, you need to first authenticate your connection. You can authenticate your connection with a username and password. The SAP connector also supports SAP Secure Network Communications (SNC) for authentication. You can use SNC for SAP NetWeaver single sign-on (SSO), or for additional security capabilities from external products.

2. Connecting and Creating a Workflow:

  1. Create a new Logic App Standard. Ref: Create Standard workflows in single-tenant Azure Logic Apps with the Azure portal - Azure Logic Apps...
  2. Upload all required SAP Private DLLs as Client/SDK Assembly (.NET Framework). See below for known issue with DLLs larger than 4 MB.
    Screenshot 2023-02-08 231243.jpgAll SAP Libraries (like sapnco.dll, sapnco_utils.exe, libicudecnumber.dll, rscp4n.dll, also visible here SNC's sapcrypto.dll, sapgenpse.exe, slcryptokernel.dll which are discussed later below) were uploaded to Assemblies.

    Throws Exception: If any of these libraries are missing, the following exception will be thrown:
    HttpStatusCodeBadRequest
    ErrorCode
    : ServiceProviderActionFailed
    ErrorMessageThe service provider action failed with error code 'ServiceOperationFailed' and error message 'SAP client library is missing. Please add pre-requisites SAP .NET Connector client library assemblies to the workflow application. Detailed error message 'Could not load file or assembly '{assembly name}'

  3. Enable vnet integration and private ports by following this article: Enabling Service Bus and SAP built-in connectors for stateful Logic Apps in Standard (microsoft.com)

  4. Add an SAP Action to the workflow.
    Screenshot 2023-02-08 231832.jpgScreenshot 2023-02-08 231856.jpg
  5. Create a connection (Refer Section 2.2) and run the workflow.
    Throws Exception: If there is any error while connecting to SAP using the created connection parameters, it will throw below exception:
    HttpStatusCodeBadRequest
    ErrorCode
    ServiceProviderActionFailed
    ErrorMessage: The service provider action failed with error code 'ServiceOperationFailed' and error message 'Call to SAP client library failed with error message '{error message}' '.

    Screenshot 2023-02-08 232331.jpg

2.2 Creating SAP Connections:

2.2.1 Using Username and Password:

  1. You can create a simple Username and Password connection by selecting 'Auth Type' as 'Basic' and providing required fields in 'Add Connection' pane.
    Screenshot 2023-03-14 184510.jpg
  2. Then click Create.

2.2.2 Using SNC

  1. You can create a SNC connection by selecting 'Auth Type' as 'Logon Using SNC' and providing required fields in 'Add Connection' pane.
    Screenshot 2023-03-14 184632.jpg
  2. For SNC to work properly, you need to upload SAP Libraries namely (sapcrypto.dll, sapgenpse.exe, slcryptokernel.dll) using Assemblies pane in Azure portal.
    Screenshot 2023-02-08 231243.jpg
  3. For SNC Partner Name, enter the backend's SNC name. For example, p:CN=DV3, OU=LA, O=MS, C=US.
  4. For SNC Certificate, enter your SNC client's public certificate in base64-encoded format. Don't include the PEM header or footer. Don't enter the private certificate here because the PSE might contain multiple private certificates, but this SNC Certificate parameter identifies the client certificate that must be used for this connection.
  5. Configure PSE settings. For PSE, enter your SNC PSE as a base64-encoded binary.
    1. The PSE must contain the private client certificate, which thumbprint matches the public client certificate that you provided in the previous step.
    2. The PSE may contain additional client certificates. We recommend however that you create separate Workflow applications if you intend to authenticate with different client certificates.
    3. The PSE must have no PIN. If needed, set the PIN to empty using the SAPGENPSE utility.
  6. Then click Create.

3. Known Issues

  1. Assemblies tab doesn't allow uploading libraries above 4MB. As a workaround you can follow steps below:
    1. All SAP libraries can be uploaded to site/wwwroot/lib/builtinOperationSdks/net472/* using kudu tool.

    2. Open Kudu tool:
      siddharth_0-1678935726351.jpeg

       

    3. Navigate to  site/wwwroot :
      siddharth_1-1678935726354.jpeg

       

    4. Create Directory lib/builtinOperationSdks/net472/ (if it does not already exist):
      siddharth_2-1678935726355.jpeg

       

    5. Upload all your SAP/SNC assemblies to site/wwwroot/lib/builtinOperationSdks/net472/*:
      Screenshot 2023-03-16 083603.jpg

NOTE: SAP Connector is in Preview and doesn't guarantee SLA and latency requirements.

4 Comments
Version history
Last update:
‎Jun 12 2023 09:33 PM
Updated by: