+ -

Pages

Saturday, July 26, 2014

Messages

. About

Messages are texts that can be shown on the bottom of the screen. Messages belongs to a message class. There different type of messages indicated by the first letter of the message indetifier.

2. Maintaining

Messages are defined in table T100.

You maintain messages and message classes using transaction SE91.

3. Syntax

Message xnnn
x is the type of message ( See: Types of messages )
nnn is the identifier of the message.
Example: message e001

4. Setting the message class

You set the message class for the whole program in the header of thje program:

report my_report message-id <xx>.

Setting the message class for a sigle message:

Message ID <Message class> type <type> number <number>

Example: message id 'ZB' type 'W' number '004' with 'Test'.

5. Types of messages

I Info Press ENTER to continue
W Warning Correction possible
E Error Correction required
A Abend Transaction terminated
X Exit Transaction terminated with short dump

S Success Message on next screen

6. Paramiterized messages


You can paramiterize messages, so that you can insert your own text programmatically
in messages.

When you define the message use &<parameter number> for the parameters:

This is a &1 message

When you call the message use the syntax

Message e001 with 'bad'

The resulting message: This is a bad message

7. Writing message into a field

Sometimes you want to store e.g. an error message from a function module in a text field instead of displaying it.

Use this syntax to store the message to the field l_errror_text.

CALL FUNCTION ... something

IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
into l_errror_text.
ENDIF.

5 ABAP Tips: Messages . About Messages are texts that can be shown on the bottom of the screen. Messages belongs to a message class. There different type of me...

No comments:

Post a Comment

< >