cancel
Showing results for 
Search instead for 
Did you mean: 

Two events firing on creation of Trip - BUS2089

Former Member
0 Kudos

Hi ,

I have built a workflow that is triggered on the BUS2089 created event. The problem is that when the trip is created or changed both the created and changed events fire. What this means is that if a trip is changed it fires the created event which triggers a new workflow even though the trip is already in one workflow. Does anyone know why both events are fired on create and change or a way to get round this problem?

Thanks

Rob

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Generally both the events gets triggered I think so as i experienced the same stuff in 2 projects. In this case you can create an attribute that will use this FM SAP_WAPI_WORKITEMS_TO_OBJECT to check whether any Workflow already exist. If it exist the Worlist parameters willnot be Initial.

You can use this attribute in start condition of Wflow

SWB_COND

Before putting Wait for Change event step make sure that this event does not get Triggered when you are approving the request:)))))

Thanks

Arghadip

Message was edited by:

Arghadip Kar

Answers (4)

Answers (4)

KKilhavn
Active Contributor
0 Kudos

Sorry about coming a bit late into the discussion....

Can't say I have any real experience with the problem, but I worked with travel & expense approvals for a few years, even if they weren't using individual workflows per trip document. Are you sure this (event "created" being created) happens always? What I am thinking about is that this possibly only happens when a new version (either PTRV_HEAD version or PTRV_PERIO version) is created.

Former Member
0 Kudos

just a long shot, but is it possible that one of the events is specified in transaction code SWEC ?

Former Member
0 Kudos

Hello Rob,

Instead of coding some fancy check function modules or configuring start conditions, you should try the following simple solution: Into your current workflow, put a "wait for event" step to wait for BUS2089.CHANGED (into a separate branch of course). So, always when this event occurs, your workflow should end. The result is that if the user decides to change the trip, the old workflow ends, but a new one starts.

I don't know the reason why the both events are triggered. Maybe it is how it should work, and easiest solution to solve this "problem" is probably the one that I just explained.

Regards,

Karri

Former Member
0 Kudos

Hi Karri,

I think you are right this solution is the simplest and seems to work fine.

Thanks

Rob

martin_nooteboom
Active Contributor
0 Kudos

Hi Rob,

I don't know why both events are triggered, but you could create a check function module which could check if there is already a workflow for the trip and if so don't start a new one. You can set the FM in the event binding.

Regards,

Martin

Former Member
0 Kudos

Hi Martin,

That is what I was going to do but I just wondered if anyone knew why these events might be firing. I wonder if it si set up anywhere in the configuration.

Rob