Product Lifecycle Management Blogs by Members
Get insider knowledge about product lifecycle management software from SAP. Tap into insights and real-world experiences with community member blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
ksinghal
Explorer

SAP Digital Manufacturing Cloud boasts powerful features that enable seamless integration with various platforms, including both SAP and non-SAP applications. This guide outlines the process of notifying workers via Microsoft Teams using the extensibility capabilities of SAP Digital Manufacturing and the Business Technology Platform (BTP).

Overview

Sending notifications to operators in Microsoft Teams when an order is released or when the resource status changes can streamline communication and ensure timely action. The key steps include:

  • Integration Setup
  • Trigger Point Configuration
  • Notification Configuration
  • Recipient Selection
  • Notification Format
  • Testing and Deployment

ksinghal_0-1718195589590.png

ksinghal_3-1718195673424.png

Step-by-Step Integration Guide

Step 1: Create a Team Channel in Microsoft Teams

  1. Click Teams on the left side of the app, then click Join or create a team at the bottom
  2. Click Create team (first card, top left corner)
  3. Build a team from scratch
  4. Choose Private to limit content and conversation to a specific set of people, or Public for a community or topic anyone in the organization can join
  5. Name your team and add an optional description
  6. Click Create

Step 2: Add Incoming Webhook App in Team Channel

  1. Click the three dots on the right-hand side of the team you created
    ksinghal_4-1718195803379.png

     

  2. Select Manage Team
  3. Switch to the Apps tab and click More apps
    ksinghal_5-1718195825039.png
  4. Search for webhook and select the Incoming Webhook app
    ksinghal_7-1718195862926.png

     

  5. Click Add to a team
  6. Ensure the correct team channel is displayed and press Set up a connector
  7. Configure the webhook with a name and image, then click Create
    ksinghal_8-1718195888888.png
  8. Copy the URL provided as it will be needed later
    ksinghal_9-1718195904071.png
  9. A message will be displayed on your team’s channel confirming the webhook creation

ksinghal_0-1718342042101.png

Step 3: Create a Destination in BTP

  1. Log onto your BTP cockpit and select the global tenant where DM is installed
  2. Expand the Connectivity section and select Destinations
    ksinghal_11-1718196001490.png
  3. Click New Destination
    ksinghal_12-1718196008595.png
  4. Configure the destination details using the URL created in the webhook setup (only the start part of the URL) and press Savksinghal_13-1718196013879.png

Step 4: Create a Server in DM

  1. In the DM Launch Pad, select Manage Web Servers
  2. Click Create and use your unique URL for the Host URL field and select your unique plant
    ksinghal_16-1718196146331.pngksinghal_17-1718196151098.png
  3. Add the Microsoft Teams destination created previously
    ksinghal_15-1718196139666.png
  4. In the DM_Cloud web server configuration, add the Microsoft Teams web server to its list of connections
    ksinghal_14-1718196129938.png

Step 5: Create a Service Registry in DM

  1. Open the Manage Service Registry app from the DM launch pad
  2. Click Create and fill in the required details in the Header and General Information sections
    (Note:- Paste the whole Incoming webhook URL in URL/path)
    ksinghal_0-1718196417164.png
  3. Enable the request body and set the Content Type to application/json
    ksinghal_1-1718196422950.png
  4. Define the inline schema and save the service
    (Note:-Replace the Schema JSON with following)
    Inline Schema

 

 

{
    "type": "object",
    "properties": {
        "type": {
            "type": "string"
        },
        "attachments": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "contentType": {
                        "type": "string"
                    },
                    "content": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string"
                            },
                            "body": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "type": {
                                            "type": "string"
                                        },
                                        "text": {
                                            "type": "string"
                                        },
                                        "wrap": {
                                            "type": "boolean"
                                        },
                                        "style": {
                                            "type": "string"
                                        },
                                        "fontType": {
                                            "type": "string"
                                        },
                                        "size": {
                                            "type": "string"
                                        },
                                        "color": {
                                            "type": "string"
                                        },
                                        "isSubtle": {
                                            "type": "boolean"
                                        },
                                        "width": {
                                            "type": "string"
                                        },
                                        "title": {
                                            "type": "string"
                                        },
                                        "value": {
                                            "type": "string"
                                        },
                                        "url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "type",
                                        "text"
                                    ]
                                }
                            },
                            "$schema": {
                                "type": "string"
                            },
                            "version": {
                                "type": "string"
                            },
                            "actions": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "type": {
                                            "type": "string"
                                        },
                                        "title": {
                                            "type": "string"
                                        },
                                        "url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "type",
                                        "title",
                                        "url"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "required": [
        "type",
        "attachments"
    ]
}

 

 

Step 6: Design Production Process in DM

  1. Open Design Production Processes from the DM Launchpad
  2. Click Create, fill in the required details, and press Create
  3. Drag and drop start, script, and end controls onto the worksheet
  4. Select Services and add the previously created service
    ksinghal_2-1718196498846.png
  5. Connect the controls in the sequence to retrieve order details, labor details, Script and  Microsoft Teams service
    Your Final Script Task should look it thisksinghal_4-1718196562316.png

    (Note:- While selecting Schema in Manage Parameter you need to select your attachementSchema that you find in Manage Service Registry>your API Services name>Request Body>Schema)

    ksinghal_5-1718196585858.png

    Final Script Code:-

 

 

$output.attachments = [{
    "contentType": "application/vnd.microsoft.card.adaptive",
    "content": {
        "type": "AdaptiveCard",
        "body": [{
            "type": "TextBlock",
            "text": "Order Released Details",
            "wrap": true,
            "style": "heading",
            "fontType": "Default",
            "size": "Large",
            "color": "Accent",
            "isSubtle": true
        },
            {
                "type": "ColumnSet",
                "columns": [{
                    "type": "Column",
                    "width": "auto",
                    "items": [{
                        "type": "TextBlock",
                        "text": "Raised By-",
                        "wrap": true
                    }]
                },
                    {
                        "type": "Column",
                        "width": "stretch",
                        "items": [{
                            "type": "TextBlock",
                            "text": $input.Supervisor,
                            "wrap": true
                        }]
                    }]
            },
            {
                "type": "ColumnSet",
                "columns": [{
                    "type": "Column",
                    "width": "auto",
                    "items": [{
                        "type": "TextBlock",
                        "text": "Assigned To-",
                        "wrap": true
                    }]
                },
                    {
                        "type": "Column",
                        "width": "stretch",
                        "items": [{
                            "type": "TextBlock",
                            "text": $input.User,
                            "wrap": true
                        }]
                    }]
            },
            {
                "type": "TextBlock",
                "text": "At Location",
                "wrap": true,
                "style": "heading",
                "separator": true,
                "size": "ExtraLarge"
            },
            {
                "type": "FactSet",
                "facts": [
                    {
                        "title": "Site-",
                        "value": $input.Plant
                    },
                    {
                    "title": "Workcenter-",
                    "value": $input.WorkCenter
                },
                    {
                        "title": "Resource-",
                        "value": $input.WorkCenter
                    }]
            },
            {
                "type": "TextBlock",
                "text": "Current Product",
                "wrap": true,
                "style": "heading",
                "separator": true,
                "size": "ExtraLarge"
            },
            {
                "type": "FactSet",
                "facts": [{
                    "title": "Order-",
                    "value": $input.OrderNumber
                },
                    {
                        "title": "SFC-",
                        "value": $input.SFC
                    }]
            }],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.5",
        "actions": [{
            "type": "Action.OpenUrl",
            "title": "View Order Details",
            "url": "https://your-dm-url.test.execution.eu20.dmc.cloud.sap/cp.portal/site#ManageOrders-Display?sap-ui-app-id-hint=sap.dm.dme.manageorder&&searchPayload="+$input.OrderNumber
        }]
    }
}]
$output.type= "message"​

 

 

     6. Now, Map your Script output

I have used different service and Script Task to fetch following Details

  1. Current Date & Time
  2. Current Supervisor Name working on particular shift at particular time period
  3. Current Operator Name working on particular shift at particular time period
  4. Plant Detail
  5. Work Center & Resource
  6. Order Details

You can also create your own card design from Adaptive Cards

Final look of Production Process for Order Releasedksinghal_6-1718196692007.pngFinal look of Production Process for Resource Status Changedksinghal_7-1718196699723.png

Step 7: Set Up Business Rule

  1. Select Manage Automatic Trigger and choose Business Rules in the DM Launch Pad
  2. Click Create and provide the necessary details in the Header and General Setting sections
  3. Configure the action to select the Production Process created earlier and map the input parameters
    For Order Released
    ksinghal_8-1718196739515.png

    For Resource Status Changed

    ksinghal_9-1718196772544.png

Step 8: Testing

  1. Press the Run or Debug button
  2. Enter the required details (Plant and Order Number) and press Run
  3. Verify that the process executes successfully and a message is shown on the Microsoft Teams Channel

Conclusion
By following these steps, SAP Digital Manufacturing Cloud is integrated with Microsoft Teams, enabling efficient notifications and communication with operators. This integration leverages the capabilities of the Business Technology Platform to enhance operational efficiency and responsiveness
Do you enjoy this post? I would love to hear your thoughts! Share your feedback in the comments section below. Every piece of feedback is highly appreciated and valued.
Relevant community resources:

Regards,
Kartik Singhal