Skip to Content
avatar image
Former Member

exclude manager from workflow

Hi experts,

How to set start condition in workflow?

here is my client case,

if Manager create "travel request" than the workflow shouldn't trigger.

I have create workflow, with start event of travel request created.

for employee who has manager, when they create travel request, workflow will send "task" to manager for approve or reject the request.

but, if the manager create travel request, I want the workflow to not be trigger.

how to achieve this?

thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Sep 18, 2010 at 04:30 PM

    Hello,

    A start condition should do it but the question is: how do you determine if someone is a "manager"?

    If A is the manager of B and creates a travel request for B then you don't want a workflow, but if A creates one for A then you do want a workflow?

    regards

    Rick Bakker

    Hanabi Technology

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2010 at 10:39 AM

    Hi,

    You can use check FM to control the triggering of WF.

    Check FM has object key as import parameter,you can use this key(pernr) to check whether the employee is manager or not.

    Use logic maintained by HR team that marks an employee as Manager.

    the interface for check FM is as below :

    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(OBJTYPE) TYPE  SWETYPECOU-OBJTYPE
    *"     VALUE(OBJKEY) TYPE  SWEINSTCOU-OBJKEY
    *"     VALUE(EVENT) TYPE  SWETYPECOU-EVENT
    *"     VALUE(RECTYPE) TYPE  SWETYPECOU-RECTYPE
    *"  EXPORTING
    *"     REFERENCE(REFERENCE) TYPE  C
    *"  TABLES
    *"      EVENT_CONTAINER STRUCTURE  SWCONT
    *"  EXCEPTIONS
    *"      NOT_TRIGGERD

    Here objkey is key of BOR object used for Travel.

    Use logic to find whether employee is manager or not, and if not raise exception. This will stop WF to trigger .

    Once you have created the WF, go to SWE2 and look for entry of your BOR object and your Workflow template number.

    Display the entry and maintain your FM in 'Check Function Module'.

    If you want to debug the code, put an external Break point in Check FM and use SWUE to trigger the workflow.

    Regards,

    Sangvir Singh

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 17, 2010 at 11:43 AM

    There are several options to achieve this

    The first one is in the event creation part, If this event is triggered in HR, then creating your own FM to trigger the event in SWEHR3 could do it.

    Another options is in workflow conditions SWB_COND, you might have to add an attribute on the Business Object so that it can be used in the conditions.

    As has been mentioned a check function module is also a possibility

    And you can model it in your workflow, using a condition, or a task with an exception and model that in the bulder.

    It all depends on the workflows used, the needed flexibility and the future needs.

    Kind regards, Rob Dielemans

    Add comment
    10|10000 characters needed characters exceeded