Skip to content

Integrate SAP Business Processes in Microsoft Teams using SAP Business Technology Platform.

License

Notifications You must be signed in to change notification settings

SAP-samples/btp-msteams-extend-workflow

REUSE status

Extend your SAP S/4HANA Business Scenarios into Microsoft Azure Ecosystem

This repository contains code samples and instructions for developing a native Microsoft Teams application that is deployed in SAP BTP. This application is used for extending the SAP S/4HANA Business scenarios.

This is how the extension application looks like:




Important Note : Please be aware that this GitHub repository is still work in progress for improvements and additional scenarios. Make sure you're pulling the repository from time to time and redeploying it in SAP BTP.

Table of Contents

Scenario
Business Process Flow
Solution Architecture
  Connect to SAP S/4HANA Using SAP BTP Connectivity Service
  Connect to SAP S/4HANA on Azure Using SAP BTP Private Link Service and Azure Private Link
Requirements
Implementation: Configuration and Development
Additional Resources
Known Issues
Reference
  Build Apps for Microsoft Teams
  Microsoft Graph API
  Bot Framework
  Adaptive Cards
Disclaimer
How to Obtain Support
Code of Conduct
Contributing
License

Scenario:

The business scenario you will be implementing here will allow SAP enterprise business users to perform the ERP operations from Microsoft Teams. Business users can receive alerts or events from SAP S/4HANA for approvals or rejections of purchase requisitions.

Business Process Flow

The extension application will provide the business user with the ability to perform ERP operations via Microsoft Teams.

plot

  1. User creates a purchase requisition in the SAP S/4HANA system, and a business workflow is started to release the purchase requisition.
  2. A background job running in the SAP S/4HANA system will pick the purchase requisition workflow instance and send an event for creating that purchase requisition to SAP Event Mesh.
  3. The extension application deployed in SAP BTP receives this event via Webhook utility.
  4. The extension application fetches the additional details of the purchase requisition by querying the SAP S/4HANA sytem using the SAP Destination service and SAP Connectivity service.
  5. The extension application sends the notification to the corresponding approver of the purchase requisition to Microsoft Teams using the Azure Bot Service.
  6. The approver can approve or reject the purchase requisition with a click of a button in the Microsoft Teams notification that calls the extension application.
  7. The extension applications sends the approval or rejection status to the SAP S/4HANA system.

Solution Architecture

We are giving two approaches for connecting SAP BTP and SAP S/4HANA.

The key services used from Microsoft Azure are the Azure Bot Service, Azure Blob Storage, Microsoft Graph, Microsoft Teams App Registration, Extension App Registration, and Azure Active Directory.

The services used from SAP BTP are the Cloud Foundry Runtime, SAP Event Mesh, SAP Connectivity service, SAP Private Link service, and SAP Destination service.

Connect SAP BTP and SAP S/4HANA using SAP Connectivity Service

This is a high-level solution architecture diagram that shows how to use the Cloud Connector and SAP Connectivity service to establish secured communication between SAP BTP and SAP S/4HANA.

plot

Connect SAP BTP and SAP S/4HANA using SAP Private Link service

This is a high-level solution architecture diagram that shows how to use the SAP Private Link service and Azure Private Link service to establish secured communication between SAP BTP and SAP S/4HANA.

plot

For more information, see Set Up Connectivity Between SAP BTP and SAP S/4HANA Using SAP Private Link Service page.

Note: In this scenario, it is mandatory to configure principal propagation.

Requirements

These are the technical prerequistics for an integration between Microsoft Teams and SAP S/4HANA.

SAP S/4HANA

  • 2 business users (for the requestor and for the approver)

Services in SAP BTP

  • Cloud Foundry Runtime
    • Foundation for running the Microsoft Teams extension application
    • Required for the trust between Microsoft Azure Active Directory and SAP BTP
  • Memory/Runtime quota
    • Required for deploying and running the extension application in SAP BTP
  • Authorization & Trust Management Service
    • Required for securing the extension application in SAP BTP

Microsoft Azure and Microsoft Teams Subscription

  • A valid Microsoft Azure subscription

  • A Microsoft Azure Active Directory

    • Required for the trust between Microsoft Azure Active Directory and SAP BTP
    • User management
    • Application registrations to allow access to Microsoft Graph API and SAP BTP
  • Microsoft Graph API

    • Used to retrieve user profile information and MS Teams data (chat members, team members also)
  • An Azure Bot Service

    • Service for Azure bots
    • Required for Bot connection between the extension application deployed in SAP BTP and Microsoft Teams
  • An Azure Storage Account

    • Required for storing the conversation references for the notifications
  • A Microsoft Teams subscription

    • Required for paid services like Azure Storage Account

Additional Information

  • Establish trust between SAP BTP and Microsoft Azure Active Directory.

  • The configurations required need admin user crdentials in all platforms (SAP BTP, Microsfot Azure, Microsoft Teams).

  • Ensure the users created in Microsoft Azure, SAP BTP and SAP S/4HANA have the same email address.

Configuration and Development

These are the steps to configure SAP S/4HANA, SAP BTP and Microsoft Azure for this scenario.

Step 1: Set Up the Subaccount in SAP BTP

Step 2: Configure Microsoft Azure Platform and Microsoft Teams

Step 3: Configure SAP S/4HANA For Business Scenario

Step 4: Connect SAP BTP and SAP S/4HANA:

Step 5: Build and Deploy the Extension Application

Step 6: Test the Extension Application

Additional Resources

This project has been implemented based on the following Microsoft Bot Builder and Microsoft Office Developer sample repositories.

Another source of inspiration are the following blog posts by Martin Raepple on setting up principal propogation between Microsoft Azure and SAP BTP.

Known Issues

These are the known issues that needs to be considered during the implementation. There will be updates to the repository. Pull the latest version and redeploy the application in SAP BTP.

  • Mobile device optimization:

    The adaptive cards are not yet optimized for picture-perfect mobile rendering. Whereas the functionality is given, the appearance of the mobile interface could be improved. This could be another challenge when optimizing the extension application for your personal needs.

  • User and admin consent:

    User and a potential admin consent have not been in scope of this application. Ensure you're granting admin consent in Microsoft Azure Active Directory for the application registration to prevent potential consent issues when calling APIs.

Reference

Build applications for Microsoft Teams

Microsoft Graph API

Bot Framework

Adaptive Cards

Disclaimer

This project has been a proof of concept, including several limitations and prerequisites. The objective was to build a Microsoft Teams extension application for an SAP S/4HANA system. For this reason, the coding should not be seen as any recommendation for productive implementation. It fulfils the purpose and requirements of a proof of concept and is not intended for productive usage. It has been declared as pure proof of concept only to give the development teams ideas for solving potential challenges when integrating Microsoft Teams and SAP S/4HANA using SAP BTP.

How to Obtain Support

Create an issue in this repository if you find a bug or have questions about the content. For additional support, ask a question in the SAP Community.

Contributing

If you wish to contribute code, offer fixes or improvements, send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.

Refer to the CONTRIBUTING file for guidelines to contributions from external parties.

For additional support, ask a question in the SAP Community.

Code of Conduct

Refer to the CODE OF CONDUCT file.

License

Copyright (c) 2022 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0, except as noted otherwise in the LICENSE file.

About

Integrate SAP Business Processes in Microsoft Teams using SAP Business Technology Platform.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •