Application Development and Automation 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: 
Read only

Messages

Former Member
0 Likes
2,191

 |Messages .... { oref TYPE mtype } ... .  

Can anyone exlain me this syntax of message....

regards

uday

useful answers will be rewarded.

4 REPLIES 4
Read only

Former Member
0 Likes
1,776

Hi,

Message Classes are container of user-defined messages. We can create our own messages to be displayed in the screen and we can create these messages in a message pool inside the message class.

SE91 is the Tcode to create a message class.

The created messages can be called from programs using the statement 'MESSAGE'.

SYNTAX:

MESSAGE <type_of_message><message id>(message_class).

TYPES OF MESSAGES:

-


S - Status message.

I - Information message.

E - Error message.

W - Warning message.

A - Abort message.

T - Terminate message.

You can create up to 1000 messages in a single message class. The message id ranges from 0 - 999.

YOu can create message class in SE91

In this u can define 1000 messages (all types of messges)

with 3 digit no start with 000 upto 999.

You can call this in ur program.

Syntax: Zmess.class name E(3 digit no.)

I(3 digit no.)

S(3 digit no.)

W(3 digit no.)

Regards,

kavitha.

Read only

Former Member
0 Likes
1,776

Hi,

Messages can be created in the transaction code SE91.

these are of 5 types :

I----Information message

E---Error message

S----status Message

W---warning message.

X---Exit Message.

The length of message class can be of maximun 30 characters.

syntax---Meaasge E001 (Zxxx). 001----it is message id can be of 3 digit lenth

Zxxx---Message class name.

OR

Directly you can add the addition MESSAGE-ID ZXXXX to the report.

and give the syntax in the report as

message E001.

where ZXXXX is Message class name.

regards,

vineela.

Edited by: Radha Vineela Aepuru on Mar 7, 2008 7:31 AM

Read only

Former Member
0 Likes
1,776

Hai Uday,

Messages

You send messages using the ABAP statement MESSAGE. The statement specifies the message class, number, and type of the message.

The message class and number are used to identify the message in table T100. The message type is one of A, E, I, S, W, or X, and defines how the ABAP runtime should process the message.

Messages can either be displayed in modal dialog boxes, or in the status bar of the screen. How a message is processed depends on its type and on the context in which the MESSAGE statement occurs.

The MESSAGE Statement

The MESSAGE statement has three variants and several additions:

Using a Global Message Class

If the introductory statement of a program contains the addition

... MESSAGE-ID <id>.

and a message class <id> contained in table T100, you can use the MESSAGE statement as follows:

MESSAGE <t><num> [WITH <f1> ... <f 4>] [RAISING <exc>].

where <t> is the single-character message type and <nnn> the three-digit message number. The system retrieves the corresponding message text from table T100 for the message class specified in the introductory statement, and displays it. The display depends on the message type and the context in which the message is sent.

Specifying the Message Statically

To specify the message class, message number, and message type statically, use the following form of the MESSAGE statement:

MESSAGE <t><nnn>(<id>) [WITH <f1> ... <f4>] [RAISING <exc>].

This statement is like the first variant, but here you specify the message class <id> within the statement. This specification overrides any message class that you may have specified at the beginning of the program.

Specifying the Message Dynamically

To specify the message class, message number, and message type dynamically, use the following form of the MESSAGE statement:

MESSAGE ID <id> TYPE <t> NUMBER <n> [WITH <f1> ... <f4>] [RAISING <exc>].

where <id>, <t>, and <n> are fields containing the message class, message number, and message type respectively. The system uses the field contents to read the appropriate message from table T100 and displays it according to the message context.

Filling Message Texts Dynamically

Message texts in table T100 can contain up to four ampersand characters as placeholders. You can replace these at runtime using the WITH addition in the MESSAGE statement:

MESSAGE ... WITH <f1> ... <f 4>.

The contents of fields <f1> ... <f4> are then inserted sequentially into the message text in place of the placeholders.

Messages and Exceptions

Within function modules and methods, you can use the RAISING addition in the MESSAGE statement to trigger exception:

MESSAGE..... RAISING <exc>.

If the calling program does not handle the exception <exc> itself, the message is displayed, and the program continues processing in the manner appropriate to the message type and context. If the calling program handles the exception, the message is not displayed, but the exception is triggered. In this case, the message class, message number, message type, and any values of placeholders are placed in the system fields SY-MSGID, SY-MSGNO, SY-MSGTY, and SY-MSGV1 to SY-MSGV4 in the calling program.

Example

REPORT DEMO_MESSAGES_SIMPLE MESSAGE-ID SABAPDOCU.

MESSAGE I014.

MESSAGE S015.

WRITE text-001.

This simple message displays an information message in a modal dialog box:

and a success message in the status bar of the next screen (in this case, a list).

Regards.

Eshwar.

Read only

Former Member
0 Likes
1,776

Hi

Messages:

This can be done in transaction SE91 - Message Maintenance.

Messages allow you to communicate with the users from your programs.

They are mainly used when the user has made an invalid entry on a screen.

To send messages from a program, you must link it to a message class.

Each message class has an ID, and usually contains a whole set of message. Each message has a single line of text, and may contain placeholders for variables (e.g. & & & - three variables).

All messages are stored in table T100.

Types of mesages:

e - error messages,

i - information messages,

s - status messages,

x - exit message,

a - abort message.

Ex:

Report zxxxx message-id zxxx.

in program write

message i001.

or

message e001.

etc.....