[ABAP] Implementation of Approval Workflow Using Telegram

SAP Telegram Integration
Avatar photo
webadmin

Technical Details

Have you ever questioned whether there is a way to simplify approval on Telegram with just one “click”? Please read this guide to learn how to integrate the Telegram chatbot with the SAP approval workflow.

Disclaimer:

Make sure you’ve set up a simple workflow in your SAP program!

TELEGRAM APPROVAL PROCESS FLOW


  1. The program will start a workflow with Task TS90000064.
  2. The ZFM_TELE_CONFIRM_APRV function module will handle the Action Approval with input parameters ( DESCRIPTION[ ], WI_ID, CHAT_ID, DOC_NUM ).
  3. The following are the two function modules where the function module will retrieve the WI_ID with the status “READY” as a value parameter:
  • To transmit an approval decision to Telegram in HTML Script conversion with the parameters (DICKEY, WI ID, CHAT ID, DOC NUM) attached, use the ZFM_SEND_TELE1 function.
  • When sending files to Telegram via the ZFM_SEND_FILES_TELE module function, ZFM_GET_ATTACHMENT is used to retrieve documents or attachments submitted to a program or workflow process. Below is an example of a Telegram output:

The user has the following action options after the approval notification enters Telegram to decide whether to approve:

Approve :

  • The URL link that is embedded in the command button will be used to process the SAP CALL API, and a confirmation for the SAP API Call process and SAP Login access will then appear.

  • If the login is successful, the server will use the SAP_WAPI_DECISION COMPLETE module function to perform the approve(dickey=1) decision by calling the ZCL_REST_GET_DICISION Module Class.

  • When everything goes according to plan, the system will notify Telegram users that their request “has been approved.”

 

 

Reject :

  • A confirmation for the SAP Call API procedure and SAP Login access will appear after the URL link that was placed in the command button has processed the SAP Call API.

  • If the login process is successful, the server will make a call to the ZCL_REST_GET_DICISION Module Class, and if the user’s request is rejected (dickey=2), the system will send them a second notification in the form of a confirmation and ask for the explanation.

  • After some specified time on the system, the Telegram API Call will be made with the URL https://api.telegram.org/bot<token>/getupdate to get back the Reason given by the user, then processed with the ZFM_GET_API_TELEGRAM function module where the data is in the form The JSON array will then be converted into an internal table in SAP using the following method:

  • The SAP WAPI DECISION COMPLETE module function will carry out the division operation if the Reason has been provided.
  • When the procedure is complete, the system will notify Telegram that the user “has been Reject.”

CONCLUSION


You can refer to all descriptions of the Implementation of the Approval Workflow Using Telegram in your SAP application.

You can seek the assistance of Agata Jonle International’s consultants if you’re still having trouble putting it into your SAP Application. As an SAP consultant, Agata Jonle International offers a wide range of services, including outsourcing, SAP support, solution design, and integration.

Are you interested? Please contact us.

Leave a Reply