cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Triggering workflow

Former Member
0 Likes
8,391

Hi Experts,

I wanted to trigger a custom workflow during sales order creation/change. As I wanted to start workflow only based on some complex conditions I have decided to trigger it from user exit MV45AFZZ/USEREXIT_SAVE_DOCUMENT. Buidling this logic as workflow starting condition  or @ event linkage is not possible.

I can think of two options here to start workflow from user exit.

Option1: Start the workflow directly with the FM SAP_WAPI_START_WORKFLOW'. I doubt workflow triggerd in this way is not linked to the transaction and thus I shouldnt be able to see this from VA02/03?

Option2: Link my custom workflow to an event and triggering the event using  FM SAP_WAPI_CREATE_EVENT. Events CREATED/CHANGED for business object BUS2032 are triggered whenever sales order is changed/created. I am confused here about what event I need to link to my workflow and trigger? Do I need to create a subtype for 2032 and link my custom workflow and trigger CREATED & CHANGED event? As I am not changing anything for the business object my question is why should I create a subtype?

Much appriciated for any calrification on this,

Thanks,

Rams V.   

View Entire Topic
Former Member
0 Likes

Thanks every one for your valuable inputs. Using FM SAP_WAPI_START_WORKFLOW has any disadvantages compared to deligation with custom event?

Former Member
0 Likes

Hello,

You should avoid using SAP_WAPI_START_WORKFLOW. Use events when you can. There are many downsides, including not being able to disable it easily and it's harder for future support to find out how the workflow gets started. Also, the workflow template has to be set to General Task.

regards

Rick Bakker