Messages in ABAP: A Terminatio N Depending On The Program Context, An Error Dialog Appears or The

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Messages in ABAP

Messages are usually used to tell the user what is going on. The following types of messages are available in ABAP.

The message appears in a dialog box, and the program terminates.


A

Terminatio

When the user has confirmed the message, control returns to the next-

highest area menu.


Depending on the program context, an error dialog appears or the

Error

program terminates.
The message appears in a dialog box. Once the user has confirmed the
message, the program continues immediately after

Status

the MESSAGE statement.


The program continues normally after the MESSAGE statement, and the

Error

message is displayed in the status bar of the next screen.


Depending on the program context, an error dialog appears or the

Warning

program terminates.
No message is displayed, and the program terminates with a short
dump. Program terminations with a short dump normally only occur

Exit

when a runtime error occurs.

The syntax for issuing a message is as follows.


MESSAGE<message>TYPE<messagetype>.

We can issue a status message as follows. Status message will be displayed in the status bar. After the
message is displayed the program continues after the MESSAGE statement.
MESSAGE'Thisisastatusmessage'TYPE'S'.

Information message will be displayed in a dialog box. Once the user has confirmed the message, the
program continues immediately after the MESSAGE statement.
MESSAGE'Thisisaninformationmessage'TYPE'I'.

Error message in report programs will be displayed in the status bar and when the user press enter, the program
terminates.
MESSAGE'Thisisanerrormessage'TYPE'E'.

Warning message behaves similar to error message in report programs.


Exit Message No message is displayed, and the program terminates with a short dump. Short dumps can be
viewed in t-code ST22.
MESSAGE'Thisproducesshortdump'TYPE'X'.

Termination Message appears in a dialog box, and the program terminates. When the user has confirmed the
message, control returns to the next-highest area menu.
MESSAGE'Thisisterminationmessage'TYPE'A'.

Instead of hardcode the message text in the program we can maintain the message text in text symbols. In order to
maintain text symbols use the menu path Goto->Text Elements->Text Symbols in ABAP editor.

In the text symbols screen we can maintain the messages with a 3 character identifier.

Then use the following message statement.


MESSAGEtext-001TYPE'I'.

You might also like