Process a User Decision Programmatically at Background
By Anirban Bhattacharjee, KPIT Cummins and Infosystems from Link
Purpose: 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).
Business 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 business requirements.
Process: The process to set this up is pretty simple.
We 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
SAP_WAPI_DECISION_COMPLETE
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.
For USER, 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 scenario-to-scenario.
Now fetching the work item IDs of the above two user decision work items from their workflow logs
Work Item ID is 2733503 (We will process APPROVE for this)
Work 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)
Now we will look at the workflow graphical log to verify which branch was executed. In this case it should be APPROVE (0001)
Result Outcome is APPROVE
So the APPROVE branch was executed here.
Now will run the function module with the other work item ID 2733501 (Process Decision Key 0002 for REJECT)
Now we will look at the workflow graphical log to verify which branch was executed. In this case it should be REJECT (0002)
Result outcome is REJECT
So the REJECT branch was executed here.
Now we will check the business work place via SBWP. The work items should have been removed.
BEFORE
AFTER
We can thus call this function module SAP_WAPI_DECISION_COMPLETE in our ABAP Program and design it for so many different purposes.
We can also call the ABAP Program at the background and process work items accordingly.
Conclusion: We have thus successfully processed a user decision step programmatically without executing the work item from the business workplace.
相关推荐
能够将整个project 中form 的 localizable 设置为true,也可以批量更改form 的属性。 下载完毕之后,将文件解压到E盘,然后,在visual studio 2010 的 tools 下面选择“options” ->“Add-in/Macros Security" 点击...
### iOS 7 UIKit User Interface Catalog知识点详解 #### 一、概览 在iOS 7的UIKit框架中,苹果提供了一份详尽的人机交互指南——**iOS 7 UIKit User Interface Catalog**,该指南全面覆盖了iOS应用程序开发中常用...
Processing a String One Character at a Time Recipe 1.2. Converting Between Characters and Numeric Codes Recipe 1.3. Testing Whether an Object Is String-like Recipe 1.4. Aligning Strings ...
The definition of an inline function needs to be in a header file, so that the compiler has the definition available for inlining at the call sites. However, implementation code properly belongs in ....
The process of invoking a button programmatically, including simulating button clicks, is explained. **4.23 Turning a Checkbutton/Radiobutton On and Off** Methods for programmatically turning ...
Code examples for closing a specific file or exiting Excel entirely using a macro, which can be useful for automating the cleanup process. **Create List of Workbooks/Worksheets in a Listbox (Page 28)...
swift-programmatically, 以编程方式无需 Storyboard 基于编程的以编程方式无需 Storyboard在UITabBarController中以编程方式在中添加制表符func application(application: UIApplication, didFinishLau
You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR ...
标题中的“Programmatically Setting Control Adapters for URL Rewriting and AJAX”指的是在编程环境中设置用于URL重写和AJAX的控件适配器的技术。URL重写是改变URL结构以优化SEO(搜索引擎优化)和提高用户体验的...
Key Features ...Create a dexterity for programmatically reading, auditing, correcting, and shaping data. Write and complete programs for taking in, formatting and outputting datasets.
Looking at the User Interface The Birth of Custom Controls Custom Controls: The Next Generation The Fundamentals of ActiveX Controls Controls at Run Time Creating a Control Project How Many ...
User interfaces play a crucial role in many applications. This chapter explores: - Best practices for creating HTML templates in Go. - Techniques for generating dynamic content and handling user input...
Include the library in your build.gradle (check badge at top for latest version) dependencies{ compile 'com.github.andremion:counterfab:x.y.z' } or in your pom.xml if you are using Maven ...
A Closer Look at Intermediate Language 7 Support for Object Orientation and Interfaces 8 Distinct Value and Reference Types 9 Strong Data Typing 9 Error Handling with Exceptions 16 Use of Attributes ...
This article (which could be found at CodeProject too) was a great reference to me and a good, live example of using the Balloon ToolTip control, but the control described suffered from its ...
ColourPickerCB.zip A combobox derived class that provides a simple color picker(36KB)<END><br>68,ComboBoxInit_src.zip Learn how to programmatically initialize a combo box.(3KB)<END><br>69,...