Hello,
In most cases, we need to customize the Workflow decision task text, and there are many ways to do it. In this Blog, i'm gonna show you how to fill a internal table (type W3HTML) and place it as the task decision text (using a HTML text as example).
So let's create a new custom Workflow, and a User Decision step:
On the Control tab, the default decision task (TS00008267) is presented:
This is the standard default decision text:
We should (as a good practice) create a copy of the default task, so go to PFTC and do it:
Create a container element (type W3HTML), as a internal table/multiline(in properties tab):
Now go to the Text tab, Edit, delete the current default text, and Insert a Expression(menu below):
Selecting the MY_HTML:
This message is presented, you could select the second or third line(depending on your needs):
Output:
Returning to the Workflow:
Now you should create another step to populate this internal table (using BOR, Class, etc.), and then pass it to the new created Task on the decision step:
Now you're all set, your custom text will be presented on the SBWP/MyInbox App as the decision text ???.
HTML example on MyInbox:
The code for the example (placed on a BOR Method, populating the MY_HTML structure)
*--------------------------------------------------------------------*
* SAP Wikis HTML Code
*--------------------------------------------------------------------*
wa_html-line = '<HTML><BODY><TABLE>'.
append wa_html to my_html.
wa_html-line = '<TR><TH>Text</TH><TH>User</TH><TR><TD>SAP Blog HTML Text</TD><TD>'.
append wa_html to my_html.
concatenate sy-uname '</TD></TR></TABLE></BODY></HTML>' into wa_html-line.
append wa_html to my_html.
*--------------------------------------------------------------------*
swc_set_table container 'MY_HTML' my_html.
*--------------------------------------------------------------------*
You should play around with some HTML table examples, like:
https://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_intro
Regards.