Wednesday 7 August 2013

AUGUST 7


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

ATerminationThe 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.
EErrorDepending on the program context, an error dialog appears or the program terminates.
IStatusThe message appears in a dialog box. Once the user has confirmed the message, the program continues immediately after the MESSAGE statement.
SErrorThe program continues normally after the MESSAGE statement, and the message is displayed in the status bar of the next screen.
WWarningDepending on the program context, an error dialog appears or the program terminates.
XExitNo message is displayed, and the program terminates with a short dump. Program terminations with a short dump normally only occur when a runtime error occurs.
The syntax for issuing a message is as follows.
MESSAGE  <message> TYPE <message_type>.

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.
Example:
MESSAGE  'This is a status message'   TYPE   'S'.
Output:
Information message will be displayed in a dialog box. Once the user has confirmed the message, the program continues immediately after the MESSAGE statement.

Example:

MESSAGE  'This is an information message'   TYPE 'I'.

Output:
Error message in report programs will be displayed in the status bar and when the user press enter, the program terminates.

Example:

MESSAGE  'This is an error message'  TYPE   'E'.
Warning message behaves similar to error message in report programs.

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.
Example:

MESSAGE  'This is a termination message' TYPE 'A'.

Output:

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