cancel
Showing results for 
Search instead for 
Did you mean: 

Terminating Event for BUS2017 Custom Method

Former Member
0 Kudos

Dear Experts,

I have an issue with the Terminating Event of the Workflow for BO : BUS2017. The event is getting triggered but receiver is not being picked.

I have created two events GR_103 and POST_105 in the Custom BO ZBUS2017 by delegating it to BUS2017. GR_103 is the triggering event for my workflow which I have triggered in the POST_DOCUMENT Method of the Implmentation for BADI : MB_MIGO_BADI.

GR_103 is triggered while doing MIGO (Goods Receipt) for Movement Type 103. My Workflow is triggered perfectly and then I have used a Dialog Asynchronous Task in which I have called the MIGO Transaction for Releasing the GR Blokced Stock using the Movement Type 105. I have created a Custom Method POST in the BO ZBUS2017 and I have used the FM: MIGO_DIALOG to call the MIGO. I am trying to raise the POST_105 event in the Method MB_DOCUMENT_BEFORE_UPDATE of the Interface IF_EX_MB_DOCUMENT_BADI. I have defined the Terminating Event for the asynchronous Task as POST_105.

Now the event POST_105 is triggered, but SWEL says 'No receiver entered'. Even the SWEINST shows the object data as the current Work Item along with Object Key, but still receiver not picked. When I try to trigger the same event in a test report by using call transaction, then the event triggers and work item gets completed without any issues.

Please advise.

Below is my terminating event code.

READ TABLE xmseg INTO wa_mseg INDEX 1.

CONCATENATE wa_mseg-mblnr wa_mseg-mjahr INTO l_objkey.

IF wa_mseg-bwart = '105' .

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = 'BUS2017'

objkey = l_objkey

event = 'POST_105'

EXCEPTIONS

objtype_not_found = 1

OTHERS = 2.

ENDIF.

Regards,

Raju.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183917
Active Contributor
0 Kudos

Hi- As mentioned by others, check for commit and WIOBJECT_ID

Alternatively, instead of raising the terminating event- "POST_105" in BAdI, try to raise the event in the same custom method. I mean, after calling the FM (MIGO_DIALOG), raise the event.

Vinoth

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you all.

Solved.

Former Member
0 Kudos

Hi Raju,

Check the objkey value you are generating in the event with the one in the workflow.

I mean WIOBJECT_ID and l_objkey.

There might be a mismatch in the key values and hence you are getting this error.

Cheers,

Raja.D

Former Member
0 Kudos

Hi All,

Thank you for the immediate response. I have forgot to mention that even I have tried using COMMIT after the Event FM but the same problem. Regarding the Objectkey, I have checked the key in debugging and the values are populating exactly. It is combination of MBLNR and GJAHR. When I tried them through a test program, I have hardcoded the values and checked the same. Then the receiver got the work item and work item got completed.

Regarding the new FM, I have used it now and found that the same is happening.

Pl advise.

Regards,

Raju

Former Member
0 Kudos

Hi All,

Thank you for the immediate response. I have forgot to mention that even I have tried using COMMIT after the Event FM but the same problem. Regarding the Objectkey, I have checked the key in debugging and the values are populating exactly. It is combination of MBLNR and GJAHR. When I tried them through a test program, I have hardcoded the values and checked the same. Then the receiver got the work item and work item got completed.

Regarding the new FM, I have used it now and found the same result.

Please advise.

Regards

Raju.

Former Member
0 Kudos

Hi All,

Thank you for the immediate response. I have forgot to mention that even I have tried using COMMIT after the Event FM but the same problem. Regarding the Objectkey, I have checked the key in debugging and the values are populating exactly. It is combination of MBLNR and GJAHR. When I tried them through a test program, I have hardcoded the values and checked the same. Then the receiver got the work item and work item got completed.

Regarding the new FM, I have used it now and found the same result.

Please advise.

Regards

Raju.

Former Member
0 Kudos

As I am unable to view my messageI have posted the same message by mistake multiple times. Please consider one message only.

former_member185167
Active Contributor
0 Kudos

Hello,

Compare the timings in the event trace (SWEL) with the workflow log (SWI1) to make sure the wait step is created before the event is created. I would double-check that key value too.

regards

Rick Bakker

hanabi technology

Former Member
0 Kudos

Thank you Vinoth & Rick,

I was only able to find that the key value is differing when I tried to trigger the event in the Method of the BO. Then only I was able to find the difference and now I found that the key value is different and that's the reason the terminating event is not completing the workflow. Thank you once again.

I was able to trace this out only after doing it as suggested by Vinoth.

Regards,

Sreenivas Rjau

former_member185167
Active Contributor
0 Kudos

Hello,

You couldn't see that the key value was different in SWEL?

regards

Rick Bakker

hanabi technology

Former Member
0 Kudos

Sorry Rick,

I did not identify it because I was just thinking that the same Material Document Number will be posted against the 103 Movement Type. After debugging in the BO Method only, I could identify this.

Regards,

Raju.

Former Member
0 Kudos

Have a COMMIT WORK after the function call. (At least test it - I am not sure if it will have some effects in your BADI - at least you will know whether the issue is about missing commit).

And please use SAP_WAPI_CREATE_EVENT instead of the old function you are using.

Also, make sure that the events will look exactly the same in event monitor SWEL when triggered from your code and when using test tool. Maybe there is some minor difference/mistake (object key, etc.) that you haven't noticed.

Regards,

Karri

Edited by: Karri Kemppi on Feb 7, 2012 8:14 AM