In ABAP programming MESSAGE statement is used for display messages in a pop-up box or in the status bar. Standard messages are stored the SAP table T100. Using Transaction code SE91 we can create our own messages and can be called using the id and number.
At the time of program execution system fields will conatins the message data. They are,
- SY-MSGID : Contains the message ID)
- SY-MSGTY : Stores the type of message
- SY-MSGNO : Contains the message number
Message Types
- A : ( Shows the errors without resuming the program execution )
- E : Error Messages ( Shows the errors and current program execution will be terminated )
- I : Informational Messages ( Just diplsaying the information and can be avoided )
- S : Success Messages ( On next screen for shoing successful process completion message )
- W : Warning Meesages ( Displaying the errors that can be ignored )
- X : Exit messages ( Immediate termination of the program and shows system dump error messages )
Syntax Usage
- MESSAGE TNUMBER. ( Here T for message type, and NUMBER for message id )
- MESSAGE ID MESGID TYPE MESGTYPE NUMBER MESGNO.( Can define all the components dynamically at the time of program execution )
Additions used with this statement
- WITH
- RAISING exception
Main run-time errors seen with this statement
- MESSAGE_TYPE_UNKNOWN
- MESSAGE_TYPE_X
Here is a sample Message screen with type I