Converting a Message type into another Message Type
By Venkateswara Rao Appikonda, Intelligroup
To convert a message type into another message type, but to retain the
functionality of the former, we can use the addition DISPLAY LIKE with the
MESSAGE statement.
Demo program:
REPORT zconvert_messagetype.
MESSAGE ID 'ED' TYPE 'S' NUMBER '006'
DISPLAY LIKE 'E'
WITH sy-uname.
When the above program is executed, the following message appears (as an
error message):

Now to check if the functionality of the original message
type is retained or not, modify the above program by adding a WRITE statement:

Following is the output, when the above program is
executed:
The conclusion is that the functionality of the SUCCESS
message is retained, even though the message is displayed as an ERROR message.
|