Skip to Content

In this blog I would like to talk 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 superior for any user/agent.This information is maintained in a custom table ZUSERS.I have created a custom function module Z_FIND_SUPERIOR which will return me back a table containing all the superior information for a particular user/agent.One point to note here is that the custom function created should have the same interface as that of the SAP standard function module RH_GET_ACTORS.The following tables parameters have to exist in the custom function module.

ACTOR_TAB STRUCTURE SWHACTOR

AC_CONTAINER STRUCTURE SWCONT

Table ZUSERS

image

FUNCTION Z_FIND_SUPERIOR

FUNCTION Z_FIND_SUPERIOR.

*”—-


“Local interface:

*”  TABLES

*”      ACTOR_TAB STRUCTURE  SWHACTOR

*”      AC_CONTAINER STRUCTURE  SWCONT

*”  EXCEPTIONS

*”      NOBODY_FOUND

*”—-


  INCLUDE

image

Go to the “Container Tab” and create a container element for the agent/user which will be passed to the function module

image

image

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 via the rule container of the workflow.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Mahaboob Pathan
    During the migration process problems have been reported for this blog. The blog content may look corrupt due to not supported HTML code on this platform. Please adjust the blog content manually before moving it to an official community.
    (0) 
  2. Ravi V Ganji
    I have craeted the Role and simulated,it is working fine but the value is not passing back to the workflow. can you help me out on this?

    Regards,
    Ravi Ganji

    (0) 
  3. S N Noorie
    Hi,

    Its very nice document.

    i have tried to creat a role for catagory : Agent Determination : function to be ecexuted.

    My function module is ZPMFM001_WF_RULE
    and in Table parametr I gave
    AC_CONTAINER     LIKE     SWCONT
    ACTOR_TAB     LIKE     SWHACTOR

    but when i try to save rule its giving error
    Function module ZPMFM001_WF_RULE doest meet the work flow conventions

    Please help.

    (0) 

Leave a Reply