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_BEFORE_UPDATE

Former Member
0 Likes
2,787

Hi All,

I have implemented one implementation to the badi MB_DOCUMENT_BAD.

while performing the 101 I have used two checks in my program.if In case chek failed I have to raise a error and stop the 101.

I Have used the code in following manner.

ROLLBACK WORK.

ERROR MESSAGE.

After getting the error message if user trying to come out from the left arrow we got a short dump.

In short dump its mentioned that we can not use the ERROR MESSAGE to the MB_DOCUMENT_BEFORE_UPDATE.

Can any one please suggest me what are the other ways to reaise a message in the user exit??

Thanks.

Sandeep.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,468

Hi !

You can use the Badi MB_CHECK_LINE_BADI to do any checks before posting is started.

It works really fine...

Regards

Rainer

Some point would be nice if that helped a bit.

5 REPLIES 5
Read only

Former Member
0 Likes
1,468

u cannt Raise Error Message In BADI , but u can Put a message in Application Log.

like this.

    msg-vbeln  = w_lips-vbeln.
    msg-posnr  = w_lips-posnr.
    msg-msgty  = 'E'.
    msg-msgid  = 'YW2'.
    msg-msgno  = '042'.
    msg-msgv1  =
    'Avail.dt for this Item/batch is later than today'.
    msg-msgv2  = w_lips-lfimg.
    msg-msgv3  = w_lips-meins.
    msg-msgv4  = w_lips-charg.
    append msg to ct_log.

Regards

Prabhu

Read only

Former Member
0 Likes
1,469

Hi !

You can use the Badi MB_CHECK_LINE_BADI to do any checks before posting is started.

It works really fine...

Regards

Rainer

Some point would be nice if that helped a bit.

Read only

0 Likes
1,468

Hi Rainer,

Thanks for uor response.

What the other options to raise a error message if u r using MB_DOCUMENT_UPDATE.

awaiting for your respones.

Thanks.

sandeep.

Read only

0 Likes
1,468

Hi !

I allways use this BADI. There may be other ways but it works fine and not complex to implement.

Here comes the docu of the BADI:

Business Add-In: Check Line Before Copying to the Blocking Table

Use

This Business Add-In (BAdI) is used in the application component MM-IM

(MM-Bestandsführung).

You can use this BAdI to perform checks at item level when you post

goods movements. The structures MKPF (header data) and MSEG (item data)

are returned.

The structures DM07M (dialog control) and VM07M (update control) are

also available. However, the data from these structures is not stored in

a database table, but instead is only used for internal control. For

this reason, SAP reserves the right to change the use of these fields as

required.

Regards

Rainer

Read only

Former Member
0 Likes
1,468

BADI: MB_QUAN_CHECK_BADI.

Method: CHECK_ITEM_DATA