cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow should not trigger when one workflow is already in process

Former Member
0 Kudos

Hi,

I have created one workflow for va21 and va22 transaction.My requirement is if one workflow has not been completed ,than another workflow should not trigger.

Suppose one quotation is created and that workflow is 'IN PROCESS', than if someone changes in va22,workflow should not trigger.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi ,

i was facing same problem pls help me with samopple code,

surjith_kumar
Active Contributor
0 Kudos

Hi,

You have to Restrict via Start Condition

1) Create an attribute in the BO

2) in the Attribute you have to right a code, that using the Object Key check the workflow Tables, whether this workflow is 'INPROCESS' or not.

3) IF 'INPROCESS' set the attribute value as '1' other wise '0'

4) In the workflow start condition, assign attribute = '0', so the workflow trigger to that Condition only

Regards,

Surjith

bpawanchand
Active Contributor
0 Kudos

I suggesst to try like this

1. I assume that you might be using a BOR to handle the activities in the first workflow ( VA21 ) , if you hvae a Z bor then create a event in that Z Bor let ( trigger_2wf ).

2. Now in the first wf define the last step as Event Creator in that step rasie the event that you have created in the Z bor exclusivley for this scenario.

3. Now in the Second Wf start events define this ( trigger_2WF ) now in the 2nd Wf gets triggered only when the first workflow raises this event .

I think this is the simple way to deal with the issue....

Former Member
0 Kudos

Create a virtual attribute that will be of type BOOLE-BOOLE. This attribute will be set if the FM SAP_WAPI_WORKITEMS_TO_OBJECT returns something if you provide the Business Object and key field.

Use this attribute in defining a start condition(SWB_COND tcode) of the wflow. If this attribute is X workflow should not trigger.

Thanks

Arghadip