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

Triggering workflow

Former Member
0 Likes
8,388

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

Hi,

When faced with the issue to only trigger a workflow based on a complex logic. I would advise you to create a subtype of the business object and delegate that business object.

1. Create your own event

2a use a check function module to influence when you want a receiver for your event SWE2

2b extend the business object with an attribute that you can use in event-->wf conditions SWB_COND

You loose felxibility and control when you only use ABAP to control triggering of workflows

option 2b gives you the most control over your business processes.

Kind regards, Rob Dielemans