> For the complete documentation index, see [llms.txt](https://docs.theconfigteam.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.theconfigteam.com/prebilt-ewm/configuration-guide/configuring-prebilt-features/microsoft-teams-integration/create-the-teams-message-send-function-module.md).

# 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*”.

<figure><img src="https://1016750988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lFTpSLijn44pippdL6u%2Fuploads%2Fgit-blob-a287fe635e7744b8a46598d823ebcf09c7ca8d0c%2Fimage%20(18).png?alt=media" alt=""><figcaption></figcaption></figure>

## 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:

<table data-header-hidden><thead><tr><th width="192.5999755859375" valign="top">Parameters Name</th><th width="157" valign="top">Typing</th><th valign="top">Typing</th></tr></thead><tbody><tr><td valign="top"><strong>Parameters Name</strong></td><td valign="top"><strong>Typing</strong></td><td valign="top"><strong>Associated Type</strong></td></tr><tr><td valign="top">IV_WAREHOUSE</td><td valign="top">TYPE</td><td valign="top">/SCWM/LGNUM</td></tr><tr><td valign="top">IV_MESSAGE_TYPE</td><td valign="top">TYPE</td><td valign="top">/TCTM/DE_EWM_OMSG_MSGTYP</td></tr><tr><td valign="top">IV_BADI_FILTER</td><td valign="top">TYPE</td><td valign="top">/TCTM/DE_EWM_OMSG_RECEIVER_TYP</td></tr><tr><td valign="top">IV_SENDER</td><td valign="top">TYPE</td><td valign="top">/TCTM/DE_EWM_OMSG_MSG_SENDER</td></tr><tr><td valign="top">IV_SENDING_USER</td><td valign="top">TYPE</td><td valign="top">UNAME</td></tr><tr><td valign="top">IT_FORM_DATA</td><td valign="top">TYPE</td><td valign="top">/TCTM/EWM_TT_OM_FORM_DATA</td></tr><tr><td valign="top">IV_TEXT</td><td valign="top">TYPE</td><td valign="top">/TCTM/DE_EWM_OMSG_MSG_TEXT</td></tr><tr><td valign="top">IV_MESSAGE_ID</td><td valign="top">TYPE</td><td valign="top">/TCTM/DE_EWM_OMSG_MSGID</td></tr><tr><td valign="top">IT_RECEIVERS</td><td valign="top">TYPE</td><td valign="top">/TCTM/EWM_TT_OM_RECEIVERS</td></tr></tbody></table>

## 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.

<table data-header-hidden><thead><tr><th valign="top">Program Name</th><th valign="top">Variable Name</th><th valign="top">Value</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><strong>Program Name</strong></td><td valign="top"><strong>Variable Name</strong></td><td valign="top"><strong>Value</strong></td><td valign="top"><strong>Description</strong></td></tr><tr><td valign="top">Indicates the program or function module that uses the variable.</td><td valign="top">Unique identifier for the variable</td><td valign="top">Actual value for the variable</td><td valign="top">Brief explanation of the variable’s purpose.</td></tr></tbody></table>

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.

{% hint style="info" %}
**Note**

The Function Module would need to be amended to include the table in which your entries are held. Define the Value field in the custom table to enforce case-sensitive input (via domain/data element or validation logic), Ensure the Value input matches the Microsoft Teams channel name exactly.
{% endhint %}

## 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.

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Class</strong></td><td valign="top"><strong>Class Description</strong></td></tr><tr><td valign="top">ZTCTM_EWM_SRV_OM_NOTIF_MSTEAMS</td><td valign="top">TCT Mobility: EWM Operator Messaging - Notif. Via MS Teams</td></tr><tr><td valign="top">ZTCTM_EWM_SRV_OM_CORE1</td><td valign="top">TCT Mobility: EWM Operator Messaging - Core</td></tr><tr><td valign="top">ZCL_OM_HANDLER</td><td valign="top">TCT Mobility: EWM Operator Messages MS Teams Inbound Handler</td></tr></tbody></table>
