cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Event for a BO

Former Member
0 Kudos

Hi Experts,

I am developing WF for tcode MD03, this transaction is used to create planned order.

I need to trigger a WF to send mail when ever a Planned order is created using MD03 tcode.

BUS2004 is the BO for Planned order, but this BO does not have any event linked to it. So my question is how to create a event to a BO.

Also, I used BTE to create a Z function module, this FM is getting triggered whenPlanned order is created using MD03 tcode. Is it possible to trigger a WF using this FM?, If yes, how?

Thanks in advance.

Regards

Balu

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member193382
Active Contributor
0 Kudos

HI Balu,

Yes it is possible to trigger your workflow using BTE. Select the BTE, create a Z FM using that BTE and in that ZFM call FM SAP_WAPI_CREATE_EVENT and pass the name of the BO, event and object key to this function module. Then create a z-product, assign your z FM to this product and activate this product.

This will do the job.

Regards,

Raj

Former Member
0 Kudos

Hi All,

Thanks for your useful suggestion.

I placed a breakpoint in the Z FM to check whether the created planned is updated in Plaf table when this FM is triggered. But i found that Plaf table is not updated when the FM is getting triggered.

Do you still recommend me to go ahead and call the WF?

Regards

Balu

surjith_kumar
Active Contributor
0 Kudos

Hi,

For this FM SAP_WAPI_CREATE_EVENT you have to pass the Object Key to trigger the Event.

If you're Using BTE, check this [link|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/207835fb-0a01-0010-34b4-fef1240ba9b7].

Regards,

Surjith

former_member217316
Contributor
0 Kudos

Hi Balu

Its not advisable to create events for a standard BO. What you can do is, create a ZBO of the supertype BUS2004, make proper delegations to it and the create the required events in the ZBO. As far as triggering the wf is concerned, Call FM: SWE_EVENT_CREATE or SAP_WAPI_START_WORKFLOW inside your Z FM. This will trigger the wf as per your requirement.

Hope this helps.

Harsh

Former Member
0 Kudos

hi Balu,

It is possible to trigger the workflow using your z-function module, in your z function module you can use the function module SAP_WAPI_TRIGGER_WORKLFOW in order to trigger the workflow.

Hope this helps.

cheers,

Saurabh Anand

Former Member
0 Kudos

Hi Saurabh,

When I tried to check this FM, i got erroe message that SAP_WAPI_TRIGGER_WORKLFOW does not exists.

Regards

Balu

former_member185167
Active Contributor
0 Kudos

Hello,

You should use your Z fm to create an event using fm SAP_WAPI_CREATE_EVENT and use that event to trigger the workflow by linking the event to the workflow.

regards

Rick Bakker

Hanabi Technology