Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

The BADI : MB_DOCUMENT_BADI during MIGO execution is getting triggered twice. Request inputs.

Former Member
0 Kudos

Dear Members,

I have implemented the BADI MB_DOCUMENT_BADI for MIGO.

And in the method: MB_DOCUMENT_BEFORE_UPDATE, I am retrieving all the GR posting and reversal related information from EKBE. Based on either the first GR posting scenario or the last reversal scenario, I need to trigger a proxy for sending the GR information to a PI system in the method MB_DOCUMENT_UPDATE. The challenge which I am facing when I am implementing the entire logic of data retrieval and proxy triggering in the first method MB_DOCUMENT_BEFORE_UPDATE is, the BADI is getting triggered twice. As a result, I am finding two records of outbound data per MIGO execution in SXMB_MONI.

And when I am incorporating the data retrieval logic in MB_DOCUMENT_BEFORE_UPDATE and proxy triggering logic in MB_DOCUMENT_UPDATE, I am encountering challenges in transferring the GR related data from MB_DOCUMENT_BEFORE_UPDATE to MB_DOCUMENT_UPDATE. I have tried using ABAP memory for the same but in vain.

Please suggest further. Is there any OSS for fixing the repeated execution of the method MB_DOCUMENT_BEFORE_UPDATE during MIGO execution.

Will appreciate your inputs.

Warm Regards,

Ram.

1 ACCEPTED SOLUTION

former_member212002
Active Contributor
0 Kudos

Check the thread below -

http://scn.sap.com/thread/3446808

Cheers!

Abhinab

5 REPLIES 5

former_member212002
Active Contributor
0 Kudos

Check the thread below -

http://scn.sap.com/thread/3446808

Cheers!

Abhinab

0 Kudos

Dear Abhinab,

Thanks for the info!

Yes, the multiple implementation of this BADI is checked in SE19 by default.

I have referred your link which suggests this. How do I uncheck this multiple implementation so that the BADI will be called only once.

Thanks!

Ram.

Former Member
0 Kudos

Hi Ram,

I think The Badi you are implementing has already implemented.Please check and if it already implement then put your logic there.

Regards

Ajit

GauthamV
Active Contributor
0 Kudos

Keep a break point in the Badi method and check global variables as well as system variables like sy-ucomm in run time.

Then you can keep a condition in your logic using those variables such that your code gets triggered only once.

Regards,

Gautham.

Former Member
0 Kudos

Dears,

Thanks for all your responses!

Please suggest me what would the best solution to this can be.

Regards,

Ram.