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

BADI_MATERIAL_CHECK

Former Member
0 Likes
6,218

Im using method CHECK_DATA in BADI BADI_MATERIAL_CHECK for some checks before saving of data in MM01 & MM02 tcodes. The badi works fine but the error message is not displayed in RED color. It is displayed in green color.

Im using following code to display error ,

MESSAGE E000(38) with errmsg RAISING APPLICATION_ERROR.

The data is not saved but the error message is not displayed in RED colour .

Kindly advise.

Im using method CHECK_DATA in BADI BADI_MATERIAL_CHECK for some checks before saving of data in MM01 & MM02 tcodes. The badi works fine but the error message is not displayed in RED color. It is displayed in green color.

Im using following code to display error ,

MESSAGE E000(38) with errmsg RAISING APPLICATION_ERROR.

The data is not saved but the error message is not displayed in RED colour .

Kindly advise.

10 REPLIES 10
Read only

GauthamV
Active Contributor
0 Likes
4,084

Try this.

MESSAGE W000(38) display like 'E'.

Read only

Former Member
0 Likes
4,084

Thanks for your reply.

Now it displays

' Errors have occurred while data was posted; choose "Errors in posting" ' which is displayed in Green Color .

I want to display in red color so that it catches user attention .

Read only

Former Member
0 Likes
4,084

MESSAGE E000(38).

or

RAISE EXCEPTION APPLICATION_ERROR.

Regards,

Lalit Mohan Gupta.

Read only

Former Member
4,084

This question is not answered yet.

I am having the same problem with include ZXMG0U02.

Read only

0 Likes
4,084

Hi Marjon,

How are you displaying the error message ?

It can be simply called by using a custom message class and number

   MESSAGE ID  '' TYPE 'E' NUMBER ''.

and no need to raise any exceptions .

Read only

0 Likes
4,084

Hello Bhanu!

I have several variation including the ones suggested above. Currently I use MESSAGE ID 'ZF' TYPE 'E' NUMBER '000' WITH ltp_msg display like 'E' RAISING OTHERS .

I have also tried RAISING APPLICATION_ERROR and RAISING ERROR_MESSAGE.

I have debugged and seen that, in include LMGMMF2I, all statements are like

MESSAGE ID AMERRDAT-MSGID TYPE MESSAGE_SUCC NUMBER AMERRDAT-MSGNO WITH AMERRDAT-MSGV1 AMERRDAT-MSGV2 AMERRDAT-MSGV3 AMERRDAT-MSGV4

So here, the message type is always shown as MESSAGE_SUCC ('S'), even though my own message type AMERRDAT-MSGTY = 'E'.

Seems like the success message is hard-wired in the program

Read only

0 Likes
4,084

Indeed i just checked it's not displaying error message as "Red"..

May be  raise it with SAP to find out why its coded that way.

Read only

0 Likes
4,084

Error reported to SAP.

Read only

0 Likes
4,084

HI Marjon,

ist there any feedback from SAP? I have the same problem?

Thanks,

Florian

Read only

4,084

Alas! It seems to be technically impossible to get this improved.

Here is the feedback that I got from SAP:

"Dear Ms Wiendels ,

Thank you for your query.

After analyzing the problem I have to tell you, that unfortunately there is no possibility, to show an error message as you expected from this

enhancement MGA00001 or BADI.

As you have already found out, the caller function catches all errors

and exceptions generated in the user exit. After catching these errors,

the caller function will process the error messages, and they will be

written out with success message type. This process is done to prevent

these errors terminating the program.

Sorry, but I can not give you a more positive answer in this problem."