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

Trigger Workflow using Function Modules

Former Member
0 Likes
3,762

I have created my first custom workflow, and all I need to do now is trigger the WF from a user exit. But I can't get the FM's to trigger my event.

- I have created an event (ZUPDATE) in SWO1 for my ZYD_ERRORS object.

- I have added this event to SWETYPV

- And i am using SWE_EVENT_CREATE_IN_UPD_TASK to try and trigger my WF.

- but when checking SWEL no event is triggered.

I am unsure of the parameters I should be using in SWE_EVENT_CREATE_IN_UPD_TASK . I am passing in ZUPDATE (event) and ZYD_ERRORS (object), but don't know what the objkey parameter should be.

Please help.

Accepted Solutions (0)

Answers (6)

Answers (6)

michael_pang4
Active Participant
0 Likes

After your user exit is triggered, is a commit work eventually triggered further down the line?

Events won't be created unless a commit work is triggered.

Former Member
0 Likes

Hi

Maintain entries in the tcode SWEC so that the event will be triggered .

For maintaining the entries check object class of in CDHDR table after running the event .

surjith_kumar
Active Contributor
0 Likes

Hi,

Use the FM as mentioned in the above thread and also refer this [article|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e06f2480-02de-2a10-72af-eed9a513a6c6].

Regards,

Surjith

Former Member
0 Likes

Hello,

Always use SAP_WAPI functions when possible. SAP_WAPI_CREATE_EVENT, in this case.

regards

Rick Bakker

Hanabi Technology

Former Member
0 Likes

Hi,

How about creating event with Function Module SWE_EVENT_CREATE.

You may leverage below code.

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = 'BUSXXXX'

objkey = obj_key

event = 'XXXX'

start_recfb_synchron = 'X'

IMPORTING

event_id = event_id

TABLES

event_container = container

EXCEPTIONS

objtype_not_found = 1

OTHERS = 2.

Regards

Shital

imthiaz_ahmed
Active Contributor
0 Likes

It is the value of key field you have defined in your BO ZYD_ERRORS.

Regards, IA