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

转 Defining Custom Rules for use in SAP Workflow

 
阅读更多

Defining Custom Rules for use in SAP Workflow

By Raghava Vakada, Mouri Tech Solutions, from link.


“I would like to explain about creating custom rules in SAP Workflow. The rules can be created or changed using the standard SAP transaction PFAC. Once the rules are created you can call these rules in any workflow via the rule container”.

In this article I am creating a rule, which will find the users based on Position id. I have created a custom function module ZWF_FIND_USERS which will return me back a position under Asset Analyst (
HRP1001-SOBID). The custom function created should have the same interface as that of the SAP standard function module RH_GET_ACTORS. The following table parameters have to exist in the custom function module.

“ACTOR_TAB STRUCTURE SWHACTOR”

“AC_CONTAINER STRUCTURE SWCONT”  

Following is the function module code:  

FUNCTION ZWF_FIND_USERS.
*"-----------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      ACTOR_TAB STRUCTURE  SWHACTOR
*"      AC_CONTAINER STRUCTURE  SWCONT
*"  EXCEPTIONS
*"      NOAGENT_FOUND
*"-----------------------------------------------------------
  INCLUDE <CNTN01>.
  DATA : POSITION_ID LIKE ZBUSAREA-OBJID,
         LT_HOLDERS TYPE STANDARD TABLE OF SWHACTOR,
         LWA_HOLDERS TYPE SWHACTOR,
         LWA_USERS TYPE STANDARD TABLE OF HRP1001,
         WA_USERS TYPE  HRP1001,
         NUM_LINES TYPE I.
*Read values assigned to the rule criteria
  SWC_GET_ELEMENT AC_CONTAINER 'POSITION_ID' POSITION_ID.
  SELECT * FROM HRP1001 INTO table LWA_USERS
  WHERE OBJID = POSITION_ID.
  IF NOT LWA_USERS IS INITIAL.
    REFRESH LT_HOLDERS[].
    loop at LWA_USERS into WA_USERS.
      Condense WA_USERS-SOBID.
      LWA_HOLDERS-OTYPE = 'US'.
      LWA_HOLDERS-OBJID = WA_USERS-SOBID.
      APPEND LWA_HOLDERS TO LT_HOLDERS.
      APPEND LINES OF LT_HOLDERS TO ACTOR_TAB.
    endloop.
  ENDIF.
  DESCRIBE TABLE ACTOR_TAB LINES NUM_LINES.
  IF NUM_LINES IS INITIAL.
    RAISE NOAGENT_FOUND.
  ENDIF.
ENDFUNCTION.

Creating a rule using the PFAC Transaction

Assign the function module
ZWF_FIND_USERS in the "Rule Definition Tab" 

Go to the "Container Tab" and create a container element for the “Position id” which will be passed to the function module 

 Our rule is created now. You can test the rule within the PFAC transaction by clicking the "Simulation" button on the application toolbar. Now this rule is ready to be used in any workflow according to your requirement via the rule container of the workflow. 

 Enter the Position Id, which is created in (PPOCW) 

 It displays Asset Analysts (users) in the “Rule resolution result”

 Now you can use this rule in any of your workflow definitions.

分享到:
评论

相关推荐

    SAP Analysis Office资料

    “Defining stylesets for crosstabs”部分,则着重于介绍如何为交叉表定义和应用样式集,包括使用SAP预设的单元格样式,创建自定义样式集,分享和删除样式集等,这有助于用户通过视觉元素来增强报告的可读性和吸引...

    ABAP Development for SAP HANA

    1.4 Application Cases for SAP HANA ................................... 53 1.5 How SAP HANA Affects Application Development ........ 56 1.5.1 New Technical Options ........................................

    SAP BW Tables

    Update rules determine how data from R/3 systems is updated in SAP BW. **Use Cases:** - Customizing the update logic for R/3 data. - Enhancing the clarity of update rule documentation. #### ...

    Defining Load-Balancing Policy in Static Cluster

    Defining Load-Balancing Policy in Static Cluster

    SAP PI Handbook 71

    It involves the use of adapters and interfaces to translate and forward messages according to predefined rules. Mediation capabilities include message transformation, message routing, and protocol ...

    ComponentOne OLAP for WinForms 2012 v3

    Provides the raw data for the analysis using a DataSource property as well as a drag-and-drop interface for defining custom views of the data. The panel is visually similar to the Microsoft Excel ...

    ComponentOne OLAP for Silverlight2012 v3 1/3

    Provides the raw data for the analysis using a DataSource property as well as a drag-and-drop interface for defining custom views of the data. The panel is visually similar to the Microsoft Excel ...

    ComponentOne OLAP for Silverlight2012 v3 2/3

    Provides the raw data for the analysis using a DataSource property as well as a drag-and-drop interface for defining custom views of the data. The panel is visually similar to the Microsoft Excel ...

    ComponentOne OLAP for Silverlight2012 v3 3/3

    Provides the raw data for the analysis using a DataSource property as well as a drag-and-drop interface for defining custom views of the data. The panel is visually similar to the Microsoft Excel ...

    Rules of Play: Game Design Fundamentals

    Chapter 11 - Defining Rules Chapter 12 - Rules on Three Levels Chapter 13 - The Rules of Digital Games Chapter 14 - Games as Emergent Systems Chapter 15 - Games as Systems of Uncertainty ...

    XDoclet in Action

    - **Custom Tags**: Techniques for defining custom tags and their attributes. - **Template Development**: Strategies for developing templates that fit specific project requirements. - **Integration ...

    c20-programmers-3rd.epub

    Written for programmers with a background in another high-level language, C++20 for Programmers applies the Deitel signature live-code approach to...Defining custom function templates and class templates

    defining decade

    the defining decade!

    Wireshark- A Guide to Color My Packets

    - **Defining Rules**: In Wireshark, you can define coloring rules that automatically apply colors to packets based on display filter conditions. For example, to highlight all HTTP packets in blue, ...

    ISO_IEC_23001-7_2011.pdf

    ISO/IEC 23001-7:2011 specifies a common encryption format for use in any file format based on ISO/IEC 14496-12, the ISO base media file format. The 'cenc' Common Encryption Scheme specifies standard ...

Global site tag (gtag.js) - Google Analytics