|
Blogs
Recently after a campaign from the workflow user groups of ASUG and VNSG SAP has released new enhancements for SAP Business Workflow. The most prominent enhancement is that SAP has finally enabled the current version of the ABAP editor when editing a BOR object in SWO1 (see note 1639167 for details). There are however a number of other improvements that can also be useful to a workflow developer and to promote these I have decided to showcase one: dynamic decision options in user decisions (see note 1648822 ). SetupTo showcase this functionality I have created a simple workflow model with a single user decision step.
At design time the user decision has 3 decision options: Approve, Reject and Terminate process.
EnhancementWithout the enhancement this step would always show these options and to hide one of the options we would need to model a condition in the workflow and add a second branch with a second user decision. With the enhancement howver we can implement a workflow exit based on interface IF_SWF_IFS_DECISION_EXIT that allows us to change the decision options at runtime, which is then included on the program exits tab of the step definition in the workflow model.
My example implementation of the exit does two things.
The ABAP code of the method is shown below. ResultThe result of this is that if I execute the user decision workflow task and the container element AMOUNT has been set to 600, I will see the following screen.
Note that the option to terminate the process is not present and the description of the approve option has been changed to include the next approver. ConclusionChanging the decision options at runtime can be a very useful. It removes the need for modeling additional branches in the workflow when you want to hide decision options based on some business logic. By changing the decision texts on a case by case basis the decision making process can be more streamlined for the end user by including more specific information about the consequence of the option. R. J. van Looy is a SAP Workflow consultant at Avelon B.V. in the Netherlands
| |||||||||||||||||||||||