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: 
mchrista
Participant
4,512

We recently came across the problem to integrate a system dependent link to the My Inbox item into SAP Flexible Workflow E-Mail notification. In this blog post, I will describe a possible solution by extending the subsequent CDS View. 

Initial Setup

Let's start from the beginning. We are running a custom SAP Flexible Workflow with two approval steps. Once, there is a new approval task, an E-Mail notification is sent out. Within the E-Mail notification, our requirement is to point to the corresponding item within SAP My Inbox.

For sending E-Mails, we are using Mail Templates which we configured from the "Maintain Email Templates" Fiori App. How this can be configured, is perfectly described in this Blog post. 

In the Mail Template, we use standard HTML link to point to the Inbox. But now, two problems arised. First, the link is system dependent and second, the Mail Template can't be changed in following systems as the mail template will be transported.

 

<a href="https://<system.domain>/sap/bc/ui2/flp#WorkflowTask-displayInbox?allItems=true&/detail/LOCAL_TGW/000000005185/TaskCollection(SAP__Origin='LOCAL_TGW',InstanceID=''{{WorkflowTaskInternalID}}')">inbox</a>

 

Solution Approach

To resolve the system dependency, we had a closer look at the mail template. The template itself doesn't have any information about the system, hence we needed to find a different solution. However, we figured that the template is fed from CDS-View "C_WORKFLOWTASK". So, can we just extend this view?

mchrista_0-1718950062763.png

In the system, we defined an extension to the Inbox and added the required system fields. As you can see from the subsequent code snippet, we took the system URL from table "httpurlloc" and added the client from a session variable.

 

extend view C_Workflowtask with /QPE/E_WF_INBOX 
    association [0..1] to httpurlloc as _http on _http.protocol = 'HTTPS' {
    _http.host as SystemHost,
    _http.port as SystemPort,
    $session.client as SystemClient
}

 

Once activated, we could see the added fields within the data fields of the "Maintain Mail Template" app.

mchrista_1-1718950142973.png

The last step was to use those fields in the link. And then, it works like a charm. 

 

<a href="https://{{SystemHost}}/sap/bc/ui2/flp?sap-client={{SystemClient}}#WorkflowTask-displayInbox&/detail/LOCAL_INBOX/{{WorkflowTaskInternalID}}/TaskCollection(SAP__Origin='LOCAL_INBOX',InstanceID='{{WorkflowTaskInternalID}}')">inbox</a>

 

Conclusion

In this blog post, I presented an approach to extend SAP Flexible Workflow E-Mail notification with a link to My Inbox. However, this approach can also be used for arbitrary other custom fields and also within other mail templates.

6 Comments
Labels in this area