Supply Chain Management Blog Posts by Members
Learn about SAP SCM software from firsthand experiences of community members. Share your own post and join the conversation about supply chain management.
cancel
Showing results for 
Search instead for 
Did you mean: 
emre_yoldas
Explorer
417

Build a UI5 Apps That Sends Alerts to Telegram&Email via Node.js and ui5.

In modern manufacturing environments, fast and reliable communication between systems and people is essential to ensure uninterrupted production and quick response to unexpected events. This article introduces a custom notification solution integrated into SAP Digital Manufacturing (SAP DM) that enables real-time alerts via Email and Telegram.

By leveraging a custom UI5 interface and backend logic, operators and system events can trigger messages automatically or manually. These notifications can be used to inform maintenance teams about machine errors, alert quality teams about non-conformance (NC) entries, or allow operators to escalate issues directly from the shop floor.

The solution enhances visibility, reduces response time, and ensures that the right people are notified instantly — whether they're in front of a screen or on a mobile device.

This article explains how the integration was implemented, the configuration steps, and key benefits for production operations.

Use Case

Create an SAP UI5 application on BTP-BAS that:

  1. Takes user input from a ui5 form.

  2. Sends it to a Node.js backend deployed on Cloud Foundry.

  3. Delivers the message to a Telegram group via the Bot API.

Step 1: Create a Telegram Bot

Actions:

  1. Open Telegram, search for @BotFather.

  2. Send /newbot, follow prompts to set a name (e.g., leverxDm).

  3. Save the API token (e.g., 7873332460:AAEZQ3pPWmVyiZjIbrQjWUwbVy******).

Key Notes:

  • Use /setprivacy  Disable if your bot needs to read group messages.

  • Use /setcommands to add custom commands like /alert

blogTelegram.png

 

 

 

 

Step 2: Add Bot to Group & Get Chat ID

Steps:

  1. Add your bot to a Telegram group.

  2. Send a test message in the group.

  3. Fetch the chat_id:

curl https://api.telegram.org/bot<TOKEN>/getUpdates

response= {
"chat": {
"id": *****, 
"title": "SAP Alerts"
}
}

Step 3: Develop & Deploy Node.js Backend

Backend Setup:

  1. Initialize a Node.js project:

    emre_yoldas_0-1743955280858.png
  2. Create server.js:
    emre_yoldas_2-1743955382257.png

 

 

 

 

 

     3. Deploy to Cloud Foundry:

cf login
cf push telegram-backend --random-route

 Step 4: Build a UI5 App in SAP BTP-BAS

Development Steps:

  1. In SAP Business Application Studio:

    • Create a new UI5 project (Fiori template).

    • Edit (Basic Code) webapp/controller/App.controller.js

emre_yoldas_3-1743955671262.png

  • Edit (Advanced code) 

emre_yoldas_7-1743956086464.png

    • UI5 View (webapp/view/App.view.xml):

emre_yoldas_4-1743955708304.png

Result

emre_yoldas_8-1743956504863.png

Bonus: Email Notifications

To send emails via SAP BTP’s Mail API:

  1. Install the SAP Cloud SDK:

  2. npm install @SAP-cloud-sdk/mail-client
  3. Extend nodeJs: server.js:

emre_yoldas_11-1743957578912.png

4. Create Destination: 

emre_yoldas_12-1743957793108.png

5. Bind the destination to the service:

emre_yoldas_13-1743958288103.png

Result:

emre_yoldas_14-1743960245080.png

 

Final Architecture

SAP UI5 App → (HTTP POST) → Node.js Backend (CF) → Telegram Bot API
                                   ↓
                           SAP Mail Service (Optional)
What's could be easyly more: 

Pco(Real time Machine Details) → SAP UI5 App → (HTTP POST) → Node.js Backend (CF) → Telegram Bot API ↓ SAP Mail Service (Optional)

Shared Advantages of Email & Telegram Notifications in SAP DM

  1. Real-Time Alerts
    Immediate notifications for machine errors, production delays, or system warnings — ensuring rapid response and reduced downtime.

  2. Operator-Initiated Messages
    Operators can manually trigger messages to report unexpected issues, safety concerns, or material shortages directly from the UI.

  3. Multi-Channel Communication
    Users can choose their preferred platform (email or Telegram) depending on urgency, accessibility, or working environment.

  4. Better Visibility for Remote Teams
    Whether in the office or on the go, responsible teams are kept in the loop — even without access to the SAP system.

  5. Custom & Contextual Messaging
    Notifications can include dynamic data like order number, station ID, error codes, timestamps, etc., for faster diagnostics.

  6. Improved Collaboration
    Team members can act faster and collaborate more effectively when relevant information is instantly shared through multiple channels.

  7. Audit-Friendly Logging
    All sent notifications (email & Telegram) can be logged for traceability and compliance purposes.

  8. Reduced Reaction Time
    Immediate delivery and visibility of messages help teams react faster than traditional escalation chains.

Conclusion

You’ve built:
✔ A UI5 app to trigger alerts.
✔ A Node.js middleware to relay messages.
 Telegram + Email notifications.

Thanks for reading! If you’ve implemented this solution, share your experience in the comments.

Emre Yoldas

ME/MII/DMC Consultant

Labels in this area