Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

display a message by creating own message class

Former Member
0 Kudos

display a message by creating own message class

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Nilesh,

Create a message class from SE91 Transaction and you can use those message in your program as below

If you have created a message class ZMESS with message E001.

Report ztest no standard page heading message id zmess.

If f1 <> f2.
 message e001 type 'E'.
endif.

Regards,

Satish

2 REPLIES 2

Former Member
0 Kudos

Hi Nilesh,

Create a message class from SE91 Transaction and you can use those message in your program as below

If you have created a message class ZMESS with message E001.

Report ztest no standard page heading message id zmess.

If f1 <> f2.
 message e001 type 'E'.
endif.

Regards,

Satish

Former Member
0 Kudos

Hi,

<b>Creating own message class</b>

Goto the transaction code SE91.

Give the message class name and create. Message class will be created

We can create the appropriate messages in that created class.

Message class should be declared in the REPORT statement with the addition MESSAGE-ID and long text should be created for each message used if possible.

REPORT <name> MESSAGE-ID <message class>.

<b>Message types:</b>

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 --> Status Message and Sucess 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.

Refer the following link for details.

http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801b3e454211d189710000e8322d00/frameset.htm

Regards,

Maha