Application Development and Automation 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: 
Read only

Error message in MB_DOCUMENT_BADI

Former Member
0 Likes
2,739

Hi,

I am using MB_DOCUMENT_BADI to do some checking of the material document before saving.

How do I stop the transaction from saving if there is an error? I have tried using an error message, but it short dumps.

Thanks

Lindy

Hi,

I am using MB_DOCUMENT_BADI to do some checking of the material document before saving.

How do I stop the transaction from saving if there is an error? I have tried using an error message, but it short dumps.

Thanks

Lindy

6 REPLIES 6
Read only

Former Member
0 Likes
1,708

Hi Lindy,

Plz provide the break point where the badi is executing then we can understand the clearly. If u want stop the transaction we should know where to stop. For that also u should put break point.

Rewards points for helpful answer.

Rgds,

P.Nag

Read only

Former Member
0 Likes
1,708

check it has any parameters for posting the error log.

parametes like CT_LOG like this .

Regards

Prabhu

Read only

shishupalreddy
Active Contributor
0 Likes
1,708

Hi,

The badi u r using will not allow any kind of messages ...if u use any message it will go for a dump.

u can choose the other badi

MB_CHECK_LINE_BADI

MB_CHECK_LINE_BADI

Better go for MB_CHECK_LINE_BADI ....even i faced the same problem then i went with the implementatio of the above then there are nomore dumps.

hope it will help u

regads

Read only

Former Member
0 Likes
1,708

Hi,

The MB_DOCUMENT_BADI does not pass any data back to the material document, but only helps save additional data (maybe in Z tables) when the Mat. Document is saved. It sounds like you may have the wrong BADI?

Guess this is not particularly useful, but looks like you may have to look for another BADI for this task. I will update the thread if I come across something.

Sudha

Read only

Former Member
0 Likes
1,708

Thanks for replying everyone.

Here is the problem in more detail.

During goods issue and goods receipt, we are capturing data into z tables. A previous abaper has done this using MB_DOCUMENT_BADI method MB_DOCUMENT_BEFORE_UPDATE.

The business has now realised that movement type 301 (stock transfer from plant to plant) is not being captured, which is where I come in. I need to add code to the badi to check this. Transaction is MB1B.

If a certain criteria is not satisfied, I need to stop this 301 movement type from saving and give an error message.

Is this possible from within MB_DOCUMENT_BADI?

Thanks

Lindy

Read only

0 Likes
1,708

I'm in ECC6, I created a BADI implementation using MB_DOCUMENT_BADI and used transaction MB1B movement type 301. I put breakpoint on the method MB_DOCUMENT_BEFORE_UPDATE, activated it and also put session break-points at BADI call points in the main SAP program SAPMM07M. When I save the transfer posting, the program doesn't break for me! Has something changed in ECC6? What version are you in Lindy?

Thanks.