/SAP_Table_Copilot

Ask any questions about data in an SAP table in Microsoft Teams.

SAP Table Copilot: Empowering SAP Data Interaction

The SAP Table Copilot is a tool designed to help SAP users in their interaction with data in SAP tables. This solution, powered by a Azure OpenAI, focuses on enhancing user experience and data accessibility through:

  • Intelligent Query Handling: Engage in a dynamic, question-and-answer format to delve into the specifics of any single SAP table, making data insights more accessible and actionable.
  • Advanced Connectivity: Leverage the sophisticated integration capabilities of the SAP ERP Table connector, part of the Microsoft Power Platform, to ensure seamless and reliable data interactions.

While this repository focuses on singular table interactions and is optimal for scenarios where single-table data conversations suffice, we acknowledge the complexity and interconnectedness of enterprise data. For use cases necessitating a dialogue involving multiple tables with interdependencies, we recommend exploring our dedicated repository at SAP Data Conversational Interface, specifically tailored for multi-table interactions.

Greetings in Teams

Greetings

Architecture

High Level Process

Prerequesites

  1. Power Platform Access
  2. Azure Subscription
  3. Azure OpenAI Service
  4. On-Premises Data Gateway
  5. SAP System
    • Access to an SAP System
    • RFC user with read permission on the specific table

Setup

Azure OpenAI Service

Import the Solution

This step will import the required components into your environment. Make sure you are connected to your Non-PROD environment.

  • Download the solution as zip file: Download the Solution.

  • Login to https://make.powerapps.com/

  • Go to Solutions.

  • Choose "Import solution".

    Import solution

  • Browse files and select the downloaded SAPTableCopilot_[version number].zip.

  • During the subsequent steps you'll need to update the connection references:

    import-step-2

  • For Teams and Office 365 you might have already connections and you could simply choose from the list. Otherwise create these as well.

  • Create the required SAP ERP Connection:

    Create SAP Connection

    Enter the RFC user name and password.

  • In the next import step you will enter your URL and KEY information for the Azure OpenAI service.

    Azure OpanAI

  • Now after refreshing and entering the connection reference you can proceed to import the solution.

  • The import warning "Solution "SAP Table Copilot" imported successfully with warnings: Flow server error returned with status code BadGateway ..." can be ignored for now as this will be fixed with the next step.

Update the SAP ERP Table Connector

Publish the Copilot

  • Login to https://web.powerva.microsoft.com/

  • You should see the imported copilot. If not check that you are in the same environment where you have imported the solution.

    Copilot

  • Click on the name and then go to "Publish"

    Publish

  • The most common publishing failure is when you forgot to turn on the flow in the previous step.

  • Go to "Settings" -> "Channels" to connect the Copilot with Teams.

Connect to Teams

  • Connect the Copilot to Teams

    Connect Teams

  • Turn on Teams

    Turn on Teams

  • Open Copilot in Teams

    Turn on Teams

  • Finally open the Copilot in Teams by using the web app instead.

  • Cancel the request to open the teams app to avoid opening your desktop app and leaving your work or school tenant.

    Add to Teams

Test the Copilot

  • A first test can be done in the "Test Copilot" area of the Copilot Studio.

  • Ask a simple question for the first test.

  • Example: "How many flight connections do we have in the SAP system?"

    Test

  • The next test can be done in Teams.

    Test

Troubleshooting

  • In case of errors most likely the primary or the child flow failed.

  • The logs of the flow run provide helpful error messages.

    Troubleshooting 1

  • In this case the copilot (bot) was not pointing to the correct Teams Channel and I had to change the value of "cr680_sapProductCopilot" to refelct the Channel of my environment.

    Troubleshooting 2


Other root causes could be:

  • SAP system not reachable
  • On-Premises Data Gateway not available or service stopped.
  • HTTP timeouts of the Azure OpenAI service.

Contributing

Contributions to enhance the capabilities are welcome.

License

This project is licensed under the MIT License.

Disclaimer

THE CONTENT OF THIS REPOSITORY IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.