`
evangxli
  • 浏览: 223678 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

转 Process a User Decision Programmatically at Background

 
阅读更多

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.

分享到:
评论

相关推荐

    Cadence User Interface SKILL Functions Reference.pdf

    The Cadence User Interface SKILL Functions ...about modifying user interfaces programmatically through SKILL functions. This manual assumes that you are familiar with the SKILL programming language.

    Joomla! 1.5 Development Cookbook.pdf

    Installing a plugin programmatically during a component installation 240 Managing categories the easy way 243 Defining JParameters using XML 245 Creating a JParameter object 247 Rendering a ...

    Localizing Windows Forms programmatically using a VS2010 Add-in

    能够将整个project 中form 的 localizable 设置为true,也可以批量更改form 的属性。 下载完毕之后,将文件解压到E盘,然后,在visual studio 2010 的 tools 下面选择“options” ->“Add-in/Macros Security" 点击...

    Programmatically Setting Control Adapters for URL Rewriting and AJAX

    Programmatically Setting Control Adapters for URL Rewriting and AJAX。

    Python Cookbook, 2nd Edition

    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 ...

    Learning iOS Programming, 2nd Edition.pdf

    and programmatically, and how to parse XML and JSON documents. The chapter also covers storing data in flat files and storing data with the SQLite database engine. Chapter 9, Using Sensors This ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    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 ....

    swift-programmatically, 以编程方式无需 Storyboard.zip

    swift-programmatically, 以编程方式无需 Storyboard 基于编程的以编程方式无需 Storyboard在UITabBarController中以编程方式在中添加制表符func application(application: UIApplication, didFinishLau

    StripedProcessButton Android库.zip

    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 ...

    Jsp中嵌入CrystalReport指南

    The first tutorial shows you how to create a report source programmatically. A report source is an object that represents a single instance of a report. You must be able to create a report source ...

    Introduction.to.Android.Application.Development(4th,2013.12) pdf

    A Brief History of Mobile Software Development 11 Way Back When 11 “The Brick” 13 Wireless Application Protocol (WAP) 15 Proprietary Mobile Platforms 17 The Open Handset Alliance 18 Google Goes ...

    iOS 人机交互指南(iOS Human Interface Guidelines)

    At a Glance 9 Great iOS Apps Embrace the Platform and HI Design Principles 9 Great App Design Begins with Some Clear Definitions 10 A Great User Experience Is Rooted in Your Attention to Detail 10 ...

    Practical Data Wrangling

    Key Features ...Create a dexterity for programmatically reading, auditing, correcting, and shaping data. Write and complete programs for taking in, formatting and outputting datasets.

    Professional.MFC.with.VC6

    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 ...

    Android代码-支持计数效果的 FloatingActionButton

    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 ...

    Professional C# 3rd Edition

    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 ...

    提示框程序Balloon ToolTip Control

    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 ...

    Visual C++ 编程资源大全(英文源码 控件)

    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,...

Global site tag (gtag.js) - Google Analytics