Create the Teams message Send function module

Create function group

In transaction SE80, create a new function group called ZTCTM_EWM_SRV_OM_NOTIF_MST with description “TCT Mobility: EWM Operator Messaging MST”.

Create function module

Add a new function module called ZTCTM_EWM_SRV_OM_NOMST_SEND with a description “TCTM: EWM OM MS Teams Send”. Copy & paste the code from the Zip file.

This function module facilitates the integration between SAP and Microsoft Teams by dynamically preparing and sending adaptive card notifications to a specific team’s channel via a HTTP webhook.

Add these parameters:

Parameters Name

Typing

Associated Type

IV_WAREHOUSE

TYPE

/SCWM/LGNUM

IV_MESSAGE_TYPE

TYPE

/TCTM/DE_EWM_OMSG_MSGTYP

IV_BADI_FILTER

TYPE

/TCTM/DE_EWM_OMSG_RECEIVER_TYP

IV_SENDER

TYPE

/TCTM/DE_EWM_OMSG_MSG_SENDER

IV_SENDING_USER

TYPE

UNAME

IT_FORM_DATA

TYPE

/TCTM/EWM_TT_OM_FORM_DATA

IV_TEXT

TYPE

/TCTM/DE_EWM_OMSG_MSG_TEXT

IV_MESSAGE_ID

TYPE

/TCTM/DE_EWM_OMSG_MSGID

IT_RECEIVERS

TYPE

/TCTM/EWM_TT_OM_RECEIVERS

TVARV / ZVARIABLE table maintenance

Depending on the system, it will be necessary to hold variable values which will be used in the Function Module related to MS Teams integration

This can be either from SAP TVARVC or a custom variable table that exist within the customer system.

These variable values represent the MS teams that have defined during the solution workshops.

Maintain the STVARV entry for program name ZTCTM_EWM_SRV_OM_NOMST_SEND and the variable name ZTCTM_TEAMS using the TVARVC table, allowing dynamic updates to the webhook URL. If the customer prefers to manage this in a custom variable table, the following table can be provided.

Program Name

Variable Name

Value

Description

Indicates the program or function module that uses the variable.

Unique identifier for the variable

Actual value for the variable

Brief explanation of the variable’s purpose.

A transaction code (e.g., ZVAR_MAINTAIN) that directly links to the maintenance view of the custom table would also be required to enable users to add, edit, or delete variables as needed in each environment.

Note

The Function Module would need to be amended to include the table in which your entries are held.

Class creation

In transaction SE24, create the following classes and paste the code into each respective class from the file provided: these classes will be used in a BAdI implementation further into this integration setup.

Class

Class Description

ZTCTM_EWM_SRV_OM_NOTIF_MSTEAMS

TCT Mobility: EWM Operator Messaging - Notif. Via MS Teams

ZTCTM_EWM_SRV_OM_CORE1

TCT Mobility: EWM Operator Messaging - Core

ZCL_OM_HANDLER

TCT Mobility: EWM Operator Messages MS Teams Inbound Handler

Last updated

Was this helpful?