Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
gregorw
Active Contributor

Context and possible options


Right now, I'm involved in a Side-by-Side Extension Product development. The application is implemented using the SAP Cloud Application Programming Model (CAP) using the NodeJS runtime. The documents maintained in the application need to be approved by a second person (approver) after a specific step. To provide the approver a seamless experience I see these options:

  • Integrate into the SAP S/4HANA on Premise "My Inbox" app

  • Integrate into SAP Task Center service

  • Integrate into Microsoft Outlook

  • Integrate into Microsoft Teams

  • Send a mail


The first option to integrate into the "My Inbox" app requires the implementation of a custom task provider class as nicely described by harish.vyas in his post Integrating 3rd Party Workflow to Fiori My Inbox.

Update, 14th May 2021: I found another option to integrate into the "My Inbox". You can implement a TCM (task consumption model)-compliant OData adapter as described in the blog post How to implement an OData provider for My Inbox from lena.grothaus and the SAP Note: 2304317 - How to implement an OData provider for Task Gateway/My Inbox.

The SAP Task Center service isn't yet available. According to the SAP TechEd 2020 session Central Workflow Inbox as a Key Intelligent Enterprise Quality [DEV112] by georgi.mladenov and ivan.vasev the GA is planned for Q2/2021. My question SAP Task Center - Add tasks from partner applications was answered by ivan.mirisola. The integration is possible using the SAP Workflow Service.

While composing this post I've re-discovered the blog post Integrating SAP Cloud Platform Workflow with Microsoft Outlook by harald.schubert. It describes in great detail how to leverage Adaptive Cards for SAP Workflow service approvals in Outlook.

Integration to Microsoft Teams


For the moment I give the Microsoft Teams option a try. First, I thought that building a Microsoft Teams Chatbot that can send proactive notifications to users might be the way to go. But even after I found this nice tutorial video Proactive messages in Microsoft Teams bots (JavaScript/Typescript) with its corresponding GitHub repository this way was too cumbersome.

During my research I've found the app Approvals in Microsoft Teams. From there the solution was just a link away: Microsoft Teams approvals with custom connectors. It seems to be possible to trigger a new approval from a Power Automate Flow and send the approval result back via a custom connector. That's the Architecture I've came up with:


 

As the bookshop-demo application already is setup for API access it was quite easy to setup security using authentication type "OAuth 2.0" with Identity Provider "Generic Oauth 2":


You find the needed Client ID and Client Secret in the credentials when you've followed my description in API access. The authorizationUrl and tokenUrl end up in the Swagger definition:
  "securityDefinitions": {
"undefined": {
"type": "oauth2",
"flow": "accessCode",
"authorizationUrl": "https://subaccount.authentication.eu10.hana.ondemand.com/oauth/authorize",
"tokenUrl": "https://subaccount.authentication.eu10.hana.ondemand.com/oauth/token",
"scopes": {}
}
}

For the connector I've defined several actions. Here you see the one for the approval. The action provides the parameters that can be filled in the flow:


After establishing the connection, I started to create this flow:


For the final result please check out this demo video:


Final thoughts


The setup was straight forward. I would think that with a combination of mraepple#content:blogposts from mraepple it should be possible to achieve even SSO from Microsoft Teams to the CAP App. Right now, other users use the connection that I've established. So I will be the user stored in the change history. For this scenario I would prefer the OAuth2 Client Credentials Flow. But that is not yet supported. You can vote at Add support for OAuth2 Client Credentials auth flow in Custom Connectors Security for it.

This is the result when searching for SAP connectors:



The question that came to my mind was then: Haven't there been announcements about a partnership between Microsoft and SAP? OK, Microsoft Teams and SAP BTP were not in the focus for the announcement: SAP partners with Microsoft for first-in-market cloud migration offerings in October 20, 2019. But in the announcement "SAP and Microsoft expand partnership and integrate Microsoft Teams across solutions January 22, 2021" it's front and center.

On the SAP Road Map Explorer (S-User required) I can see quite a list regarding SAP Cloud for Customer. But I can't find any other products. 3 months after the announcement I would expect more. Where is the promised integration scenarios between SAP S/4HANA and Microsoft Teams that thomas.saueressig mentioned in the LinkedIn post Microsoft and SAP: Expanding Our Partnership? Seems we have to wait until the announcements at SAPPHIRE NOW 2021 starting 2nd June 2021.
11 Comments
thomas_jung
Developer Advocate
Developer Advocate
Really nice example of using CAP outside the usual use cases. Great inspiration for others.
pierre_dominique2
Contributor
I don't know why but we often seem to work on the exact same topics Gregor. 😉

Thanks for sharing this, this is another scenario I had on my todo list so this should be very useful.
drvup
Contributor
Great stuff, Gregor! This is the out-of-the-box thinking who is helping to see the opportunities in the cloud. At the end it's just REST-(wonder-) full.

I am also having the challenge how to explain the customer why they will need 2 different inboxes on S/4 right now .. so this could be another useful approach!

Thank you for sharing!
MustafaBensan
Active Contributor
Hi Gregor,

A very good example of integrating multiple technologies.  If I have understand correctly, you are implementing a side-by-side extension for S/4HANA on-premise.  During workflow discussions I've had, it comes up that the best practice is to use the workflow engine of the core system (eg. S/4HANA) so that there is a single, consistent workflow hub that can be accessed by multiple channels.  Indeed, even the Microsoft Teams approvals with custom connectors reference states "You can use the approvals hub in Microsoft Teams to quickly integrate approvals workflows into existing line of business apps that do not have their own approvals system".  What are your thoughts about this?

Also, since your extension is deployed on BTP, what about using the BTP Workflow Service?
MustafaBensan
Active Contributor
0 Kudos
Hi Cedric,

For your scenario, assuming that with S/4HANA you already have the Fiori My Inbox app implemented, why is there a need to develop another inbox instead of integrating the new workflow with the existing My Inbox?
drvup
Contributor
0 Kudos
Hi Mustafa,

it is about S/4 HANA Public Cloud and there we do not have the chance to add custom made workflows within the S/4-My Inbox.

SAP was announcing back in 2019 something called "One Inbox" or "Central Inbox" - unfortunately I do not know what the progress is about. The idea was to provide a central place for all workitems within the hole landscape.

In my case, this resolved into 2 different "My Inbox" apps on the S/4 FLP.
gregorw
Active Contributor
Hi Mustafa,

thank you for your feedback. Have you read through the section "Context and possible options"? I've checked the option to use the S/4HANA My Inbox. But if you know about about another option then implementing the custom feeder class I'm open for ideas. Is there maybe a way to create a generic workflow with just a link to our Side-by-Side extension via an released API?

Best regards
Gregor
jack_graus2
Active Contributor
0 Kudos
Hello

You use a customer connector to connect from Power Automate to SAP. What is the benefit of using a customer connector ? As using the Power Automate HTTP connector would also be possible and prevents developing a customer connector.

Regards Jack
gregorw
Active Contributor
Dear Jack,

I would hope for a connector that allows user propagation. Right only one user is used.

Best regards
Gregor
jack_graus2
Active Contributor
0 Kudos
Thanks, that clarifies. We do use a similar Power Automate invoice approve scenario where we exchange invoice and invoice release by IDOC. Where the IDOC's are exchanged by HTTP and the standard Power Automate HTTP connector. In that scenario a single SAP service user is being used. So when user propagation is required a customer connector might be required.

Regards
albertoliu1993
Advisor
Advisor
0 Kudos

Hi Gregor,

 

After went through the blog and bookstore demo app source code, I have one question regarding the Power Automator trigger would like to double check with you.

If I'm understand correct, we have to define the trigger inside of the custom connector in the Power Automator, and then we could build the flow on top of this trigger.

When I try to define the trigger in the custom connector it asks me to provide an API endpoint, request payload to define the webhook. In your screenshot I'm seeing that you provided Azure logic apps endpoint, may I know does this means that the SAP CAP app will send the request to Azure logic apps after user create the new approval record in the Fiori frontend app?

 

Also in the bookstore demo app source code, we will send an HTTPS request after user create the approval record through the destination, does this destination also pointing to the same Azure Logic Apps endpoint ?

 

Best Regard,

Weikun Liu

Labels in this area