banner



How To Create Class In Sap Abap Using Se24

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 Type Effect Description
A Termination Message The 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.
E Error Message Depending on the program context, an error dialog appears or the program terminates.
I Information The message appears in a dialog box. Once the user has confirmed the message, the program continues immediately after the MESSAGE statement.
S Success Message The program continues normally after the MESSAGE statement, and the message is displayed in the status bar of the next screen.
W Warning Depending on the program context, an error dialog appears or the program terminates.
X Exit No 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.

REPORT < REPORT NAME > message-id < MESSAGE CLASS > "Double click on message class

REPORT ZSAP message - id ZMESS "you need double click ZMESS to create message class

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

REPORT ZABAP message - id ZMESS

START - OF - SELECTION .

MESSAGE S001 "Display Message Text in Message No 001 and S ( Success ) Message Type

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

REPORT ZABAP .

START - OF - SELECTION .

MESSAGE S001 ( ZMESS ) "Display Message Text in Message No 001 and S ( Success ) Message Type

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.

REPORT ZTEST.

START-OF-SELECTION .

MESSAGE S001 (ZMESS) WITH 'Eat' 'Drink' .

Output :

create-message-class-3

Incoming search terms:

message class in sap abap,sap message class,abap message class,message class abap,message class in abap,message class sap abap,message class in sap,abap message,how to create message class in sap abap,message abap

How To Create Class In Sap Abap Using Se24

Source: https://www.saptutorial.org/use-message-class-abap/

Posted by: alcarazliplet.blogspot.com

0 Response to "How To Create Class In Sap Abap Using Se24"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel