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: 

BADI MB_DOCUMENT_BADI

Former Member
0 Kudos

Hi All,

I have created one implementation to the BADI MB_DOCUMENT_BADI. This badi will hit while creation of material document.I have write the code in method MB_DOCUMENT_BEFORE_UPDATE such that it will act only for certain movement types specially for t-codeMb1a and MB31.

What problem I am facing i have used a error message "MB_DOCUMENT_BEFORE_UPDATE" in this method.If we got the erroe message then we dont need to post the material dcoument,but here problem is that if the material document could not posted then it corrupt the material and when we performing 261/101 we got error message like " Inconsistency between MM and ML for material and plant"

Can anybody elebrate the problem why its happining and what will be the solution to the issue.

Thanks ,

sandeep.

11 REPLIES 11

Former Member
0 Kudos

Hi,

You cant use message type 'e' especially in BADI, avoid using type 'e' messages, instead give a pop-up message using the function module POPUP_TO_CONFIRM, and process based on the user's action,

Hope this helps,

Rgds,

0 Kudos

Thanks Sailatha, But if I put a pop message to the badi

will it also create a issue if we are aborting the program.

regards,

sandeep

0 Kudos

Hi,

This needs to be handled in the program based on the user action, you can either 'exit' the program or 'continue' processing, refer the sample code below,

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'Confirm'

TEXT_QUESTION = 'Do you want to continue or exit'

TEXT_BUTTON_1 = 'Continue'

TEXT_BUTTON_2 = 'Exit'

DISPLAY_CANCEL_BUTTON = ' '

IMPORTING

ANSWER = LV_ANSWER.

IF LV_ANSWER = 1.

Handle the error,

endif.

Hope this helps,

Rgds,

0 Kudos

Hi Sailatha,

Thanks for your valuable suggestion.and its worked.

As I have used the popup to confirm function to the BADI MB_DOCUMENT_BADI.Its working as expecting when we are doing Good receipt using t-code MB31 manually.But when we are doing 101 using t-code MIGO through Idoc prcoessing its giving us a short dump. As its require human intervention to come out from the screen.

As I have seen that u have faced the same problem in the past and have a good on hand experience to the BADI.

Please suggest us as we are in integeration testing.

Thanks,

Sandeep.

Former Member
0 Kudos

Hi sandeep,

1. On reading the documentation of this badi,

your error is already documented in it.

2. such scenario will happen, as written in documentation.

3. for your requirement, one way

is that configuration is made in such a way,

that FI document are not posted for those

movement types.

regards,

amit m.

0 Kudos

can u please send me give me the link to the documentation, please

Former Member
0 Kudos

Hi again,

1. the documentation is already contained

in the tcode se18

2. enter MB_DOCUMENT_BADI

3. display

4. then press 'Documentation' Button on application toolbar.

regards,

amit m.

Former Member
0 Kudos

I would suggest you to use a different badi because in MB_DOCUMENT_BADI you are not supposed to throw out any error messages. USe badi MB_CHECK_LINE_BADI instead.

Here MSEG, MKPF data is available, so you do your custome checks and raise any message if necessary.

0 Kudos

Hi Sharath,

We have aready one implementation to the BADI MB_DOCUMENT_BADI and we are using this implementation for posting the Material document.Our new badi is only doing the calculation part.so the issue is we are upgrading the existing implementation to the BADI MB_DOPCUMENT_BADI thats why we can not think to the use of other BADI.

Please suggest.

Thanks.

Sandeeo.

0 Kudos

Hi,

Try BADI MB_MIGO_ITEM_BADI. This gets executed much before save. So, you should be able to issue error messages here.

Thanks,

Murali

shishupalreddy
Active Contributor
0 Kudos

Hello Sandeep ,

I just checked with the BADI

MB_CHECK_LINE_BADI

It is working as expected .

u can check