Skip to Content
Technical Articles
Author's profile photo Mohammed Aathif

SAP Password reset tool – Part 2


In my previous blog post, I have demonstrated how we can reset SAP password by just sending an email. But there were questions raised by many readers regarding UI, so today I will be explaining how we can beautify the user input.

Our tool has now evolved to a semi-bot, you send an email and an adaptive card will be sent to your Teams where we can select SAP-client and user id mapped to our email.


I would recommend you to first read my previous blog post if you have not read it already. It is a continuation of my previous post, so I won’t be detailing SAP ABAP, SAP PO, or Integration Suite configuration as it remains the same.

SAP Password reset tool using Azure Logic App, SAP PO/Integration Suite and ABAP


Now the only thing I added is an Adaptive card Teams connector to my Azure Logic App.

Logic App – Adaptive Card

I have designed my adaptive card in the official Microsoft adaptive card designer Adaptive Cards Designer.




After adding the connector, whenever we send an email(you don’t have to worry about JSON structure in the email body this time 😉) we will be getting a teams message from Power Automate with an adaptive card where we just have to select the radio buttons. isn’t it amazing? 🙂

In the adaptive card, I have dynamically added the recipient from the sender email(From) from the “When a new email arrives” connector.


recipient in Adaptive Card

As soon as we send an email, the Logic App will trigger and the adaptive card will send a message to Microsoft teams.

Step 1:

send an email with the below subject line. (check my previous post to know why I am adding subject line )



Step 2:

The notification arrived in Microsoft Teams


Adaptive card received in teams

Step 3:

as we select and submit Client (in step 2), a new popup will appear like below with user-id (retrieved from SAP) and user choice (unlock/reset)


User unlock or reset

Step 4:

Finally, after selecting user-id and action (Unlock or Reset) it will hit SAP and reset or unlock based on user choice.



for the above adaptive card connector I have composed a message and dynamically added SAP users to it.


Dynamically added SAP users

to fetch the users registered against email-id, I am using another HTTP connector and hitting the SAP endpoint. finally, from SAP tables user ids are retrieved.

Step 5:

Finally, if everything goes well. SAP will do its job and return back the result to Logic App. then the Logic app will compose an email, and return it back to the email sender with an appropriate message.


Final email sent by Logic App


My workflow looks like below.


Some other information:-

To fetch the list of users in SAP for an email-id, use the below query.

    SELECT b~bname INTO TABLE @DATA(lt_usr)
      FROM adr6 AS a
      INNER JOIN usr21 AS b
      ON a~addrnumber EQ b~addrnumber
      AND a~persnumber EQ b~persnumber
      WHERE a~smtp_addr EQ @ev_email.

      IF sy-subrc IS INITIAL.
        it_users = lt_usr.
         iv_msg = 'No user maintained for email'.



In this blog post, I have used SAP PO to hit SAP ECC6 via PROXY, but developers can directly Hit ABAP RAP endpoint and get this done. Other ways of doing this are by creating a custom Function Module in SAP and directly invoking FM by using SAP Connector in Logic App.

If you have any thoughts, please write in the comment section.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Mustafa Bensan
      Mustafa Bensan

      Hi Mohammed,

      For clarity, can you provide an example of the content of the email that a user has to send in order to trigger the Teams Adaptive Card?



      Author's profile photo Mohammed Aathif
      Mohammed Aathif
      Blog Post Author

      Hi Mustafa Bensan,


      Email body can be anything or can be blank too, content of the email is completely ignored.


      To trigger a workflow it only needs to find a new email in the specific outlook folder (In my case I have created a new folder called "Password reset", so any new email with the above subject line will be automatically moved to the folder)

      Author's profile photo Mustafa Bensan
      Mustafa Bensan

      Okay, thanks Mohammed.  That's certainly an improved user experience.