|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Process a User Decision Programmatically at Background
By Anirban Bhattacharjee, KPIT Cummins and Infosystems
This document will show how to process a branch in a User Decision step in
workflow via an ABAP Program running at the background. The desired branch can
be executed programmatically without the approver having to process the work
item from the SAP Inbox (SBWP or UWL).
Scenario: There are some business requirements
where a user decision step needs to be processed at the background. For example,
if we need to process auto rejection when a user decision is not executed within
a stipulated time, we can employ this technique. We can also create an ABAP
Program by which an approver can also process mass approval / rejection of all
user decision work items. So this technique can come pretty handy on different
The process to set this up is pretty simple.
simply need to call a function module and pass the work item ID of the User
Decision along with the decision branch.
We will discuss in details on how to
achieve this functionality.
For our demo, I will consider two user
decision work items that are sitting in a user’s business workplace.
We will process APPROVE for one and
REJECT branch for the other without executing them from business workplace (SBWP)
or UWL in portal.
The two work items in the business
work place of the user are shown below
We now look each the user decision
step in workflow
Thus the APPROVE will correspond to
branch 0001 and REJECT will correspond to 0002. If the step had other decision
options, they would get numbered as 0003, 0004 and so on.
Now to process the user decision via
an ABAP program without executing the work item from SBWP or Portal UWL we need
to run the following function module
Let us see what importing data this
function module needs
Here in the parameter WORKITEM_ID we will pass the work item ID of the User Decision Step.
the default is SY-UNAME. Hence if this function module is called in an ABAP
Program and that program is executed at the background, it will pass the
background system user ID.
The parameter DECISION_KEY
decides which branch has to be processed in the User Decision Step. As explained
before, we will pass 0001 for APPROVE and 0002 for REJECT.
This will differ from case-to-case and
Now fetching the work item IDs of the
above two user decision work items from their workflow logs
Item ID is 2733503 (We will process APPROVE for this)
Item ID is 2733501 (We will process REJECT for this)
Running the function module with work
item ID 2733503 (Process Decision Key
0001 for APPROVE)
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards