Fake Messages [ABAP]
Thursday, August 5th, 2010You can show fake messages by using “DISPLAY LIKE dtype” option of MESSAGE statement. For example you can show a S (Success) message as E (Error) message.
MESSAGE … DISPLAY LIKE dtype
When you use this addition, the icon of the message type specified in dtype is displayed instead of the associated icon. A character-type data object is expected for dtype. This data object has to contain one of the values “A”, “E”, “I”, “S” or “W” in upper-case letters.
The message short text is still displayed as a dialog window for messages that are displayed this way by default. 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, independently of 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.