The syntax to write a message are.
1. MESSAGE xnnn.
2. MESSAGE ID id TYPE mtype NUMBER n.
3. MESSAGE xnnn(mid).
There are 6 types of messages you use in ABAP
A (Abend)
Termination
E (Error)
Error
I (Info)
Information
S (Status)
Status message
W (Warning)
Warning
X (Exit)
Termination with short dump
Let’s let’s create a program report and write this code below.
Double click the message id name until you’re prompted with a confirmation to create Object, click YES.
After that, click the Messages tab and begin to type in your messages, in this example I’m creating 2 messages. Click save button and go back to the program report (just use the back button)
Now type in below syntax.
In code above, I’m using s000 it means that it’s a single message with message number 000. If you want to display error message just change the prefix into e000 (ztestmessage)
When you run the program (F8) you will see this message.
Post a Comment