What is Message Class

Message class is container of message text that will be displayed to users, they are stored under unique number, similar to the text elements, the message class can be reused in multiple programs and function module.

Message TypeEffectDescription
ATermination MessageThe 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.
EError MessageDepending on the program context, an error dialog appears or the program terminates.
IInformationThe message appears in a dialog box. Once the user has confirmed the message, the program continues immediately after the MESSAGE statement.
SSuccess MessageThe 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. Message type X allows you to force a program termination. The short dump contains the message ID.

You can create message class in two ways.

  1. Using t-code SE91
  2. Through ABAP Program via t-code SE38

Creating message using t-code SE91

Go to SE91 and give name of message class ZMESS and click CREATE.

create-message-class

After you press button CREATE, the new screen will be showed, in this screen you can click Messages tab to start adding messages. then click SAVE after you finished.

create-message-class-message-text-abap

Create Message class using SE38 ABAP Program

You can create message class through SE38 ABAP Program, first you need to write ABAP Keyword MESSAGE-ID on the top of your ABAP Program after ABAP Keyword REPORT.

How to use Message Class in ABAP Program

There are two ways of using message classes via ABAP Program.

1.Define your message class for report

You can use your message class by defining on top of ABAP Program after REPORT , check following ABAP Code

2.Using Message class directly using your message class and message number.

You can see success message like below.

create-message-class.jpg-display

Call Message Class with Parameter

You need to write & in your message text within message class to specify parameter.

create-message-class-1

In ABAP Program you can put parameter ( & ) in message class with some information.

Output :

create-message-class-3

 

 

Incoming search terms:

Comments

  1. alexander

    Нey there! Do you know if they makе any plugins to help
    witһ Search Engine Optimization? I’m trying to get
    my ƅlog to rank for ѕome targeted keywords but I’m not seeing ѵery ɡood reѕults.
    If you know of any please share. Kudos!

Leave a Reply

Your email address will not be published. Required fields are marked *