2009 Apr 20 6:33 AM
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.
2009 Apr 20 6:35 AM
2009 Apr 20 6:39 AM
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 .
2009 Apr 20 7:35 AM
MESSAGE E000(38).
or
RAISE EXCEPTION APPLICATION_ERROR.
Regards,
Lalit Mohan Gupta.
2013 Feb 12 3:10 PM
This question is not answered yet.
I am having the same problem with include ZXMG0U02.
2013 Feb 12 3:30 PM
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 .
2013 Feb 12 3:39 PM
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
2013 Feb 12 5:37 PM
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.
2013 Feb 13 9:25 AM
2013 Feb 18 9:35 AM
HI Marjon,
ist there any feedback from SAP? I have the same problem?
Thanks,
Florian
2013 Feb 20 8:19 AM
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."