cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with the Travel Management Workflow

Former Member
0 Kudos

Hi Experts,

I have developed a Custom Travel Managment Workflow which is triggered whenever a Trip is created in SAP. Now in the Workflow If I change the trip and Save the Trip again my Workflow is triggering because the CREATED event is triggering along with the CHANGE event (Verified through SWEL transaction) which doing SAVE operation. I am not sure why CREATED event is triggering instead I am expecting only CHANGE event should trigger.

Please help me how can I achieve the above request.

Thanks in adavnce.

Regards,

Srinivas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Srinivas,

It is a standard behavior of Travel workflow. Even you change the travel request, the Created event will trigger.

But you can manage this using Fork step and Wait event. In the workflow create a forq atep and create a wait for event in one branch. In the wait for event, create a BUS2089 - Changed.

In the fork branch will be 2 and necessary branch should be 1. So if the change event occured the wait step will be triggered. In this branch you can implement your business logic.

Thanks,

Viji.

Former Member
0 Kudos

Hi Viji,

Thanks for your reply..I am already using the Fork Logic but if we write the changed logic under the Changes then again the Created Event will be triggered (As we are doing the changes to the trip) then again the FORK step will be executed. Please let me know if my understnading is correct.

Regards,

Srinivas

Answers (5)

Answers (5)

Former Member
0 Kudos

Solved the Problem...

Former Member
0 Kudos

Also, for input parameter SELECTION_STATUS_VARIANT, these are the possible values:

0000 All Instances

0001 Active Instances (Running, Ready, Committed,...) - This is the default if you don't provide anything.

0002 Finished Instances (Completed, Cancelled)

0003 Active Instances (All)

Former Member
0 Kudos

It is straight forward. Put the object type and key and it should work.

Former Member
0 Kudos

You can use function module SAP_WAPI_WORKITEMS_TO_OBJECT.

A helpful tip is to look for function modules that start with SAP_WAPI as Rick Bakkar always recommend.

Former Member
0 Kudos

Hi Abullah,

Do you have sample code for this function Module on how to use. As there is no Function Module Documentation for this.

Regards,

Srinivas

Former Member
0 Kudos

If this is standard behavior as per Viji above, I recommend that you create a check function module for the "Created" workflow. In this function module you can check if a workflow instance already exists for that trip. If no instance exist, let the workflow instantiate as it should. If an instance exists, raise an exception and a new workflow instance will not be triggered.

As far as the "Created" event being triggered when you change a trip, this sounds a little odd. You might want to create an OSS message and get SAP to look into it. One question for you, are you sure you are using the correct object? You might want to verify that.

Former Member
0 Kudos

Hi Abdullah,

Thanks for your reply Can you please let me know how can I check for a instance of the Workflow for a specific Trip. I have created a check Function Module but not sure about the instantiation of the Workflow. Like I need to look for an entry in a table or something else.

FYI...My check function module contains the Paramaters similar to the standard Function Module 'SWB_CHECK_FB_START_COND_EVAL' and I knew that I need to assign it in the transcation SWETYPV for my BO.

Regards,

Srinivas