cancel
Showing results for 
Search instead for 
Did you mean: 

Program Exits in Activity step is triggering 7 times in Subworkflow

Former Member
0 Kudos

Dear Experts,

I have created a subworkflow in which i have added an activity step, created a task for BUS2250-Validate method and written my code in programe exit to send mail by creating a class for interface IF_SWF_IFS_WORKITEM_EXIT and inside method IF_SWF_IFS_WORKITEM_EXIT~EVENT_RAISED i have written my code.

Now the problem is that whenever i run my subwworkflow alone, the code is getting executed again and again so getting mails 6 to 7 times.

What should i do now??

kindly suggest.

Thanks

Kavya.

Accepted Solutions (1)

Accepted Solutions (1)

sbl
Active Contributor
0 Kudos

Hi

The exit is triggered for each event, so you have to capture the event

Something like

if im_event_name = SWRCO_EVENT_AFTER_CREATION.

* Call YOUR method AFTER_WI_CREATION

     me->after_wi_creation( ).

     endif.


Cheers

stephane



Former Member
0 Kudos

Yes, I have done the same....now the issue is resolved...thank you

sbl
Active Contributor
0 Kudos

Hi Kavya,

Please mark the thread as solved 😉

Cheers

Stephane

Answers (1)

Answers (1)

ronen_weisz
Active Contributor
0 Kudos

There is no need for using a program exit for sending mails, simply use a "send mail" step to send the mail.