Search code examples
abaperror-messagingdynpro

How to change message class icon?


I try to change the error message indicator from Warning to Error

I change my code from below:

message W101(ZPP) with 'PPTMEL' lv_value lw_resb-charg .

to

message E101(ZPP) with 'PPTMEL' lv_value lw_resb-charg .

However nothing change, hopefully can get some advise.


Solution

  • You can specify that behavior with the DISPLAY LIKE addition.

    Effect

    When this addition is used, the icon of the message type specified in dtype is displayed instead of the associated icon. dtype expects a character-like data objects containing one of the values "A", "E", "I", "S", or "W" in uppercase letters.

    For messages displayed in a dialog box by default, the short text is still displayed as a dialog box. Messages with the type "E" or "W" (except those for PBO and LOAD-OF-PROGRAM) are displayed as a dialog window if dtype contains "A" or "I". Messages with the type "S" are always displayed in the status bar, regardless of the dtype. The latter also applies to messages of the type "I" for PBO and LOAD-OF-PROGRAM. Messages of the type "X" always cause a runtime error.

    Notes

    The usage of this addition does not influence the behavior determined by the message type, but only the type of display.

    Specifying "X" for dtype is not recommended, since no icon is assigned to this message type.

    So in your case message E101(ZPP) with 'PPTMEL' lv_value lw_resb-charg display like 'E'.

    SAP has a few unexpected handlings of messages which are described in the docu.

    For example:

    In list processing, a message of type "W" is always converted to type "E" before further context-dependent handling takes place. The message is then handled in accordance with the other context.

    So without DISPLAY LIKE 'W' in your message statement your warning message would have a error icon. I assume something similar happens in your processing.