Show TOC Start of Content Area

Procedure documentation Defining User Messages  Locate the document in its SAP Library structure

You can display a message for the user which will inform, for example, that an error has occurred.

This section describes the steps you perform in the Message Editor tool. For more information concerning the IWDMessageManager class, refer to Displaying User Messages.

With the Message Editor you can create, change, and delete messages. You store the message text in the message pool by means of the Message Editor tool. In a second step you refer to their message key in the coding. You can create a user message of the following available types:

      Success

      Warning

      Error

      Info

      Text

At runtime, all message types (except the Text type) are the displayed with an icon indicating the assigned type.

Note

You use the Text type, for example, if you do not want to assign one of the message types at design time. Messages of this type are of type IWDText. You access these messages through class IWDTextAccessor. To display the message with the required icon, you then use the appropriate method.

Prerequisites

      The initial component has been created and is displayed in the Web Dynpro Explorer view.

      The context attribute, the UI element is bound to, is not of a Basic Type data type. This is because, if it is, all messages are generated automatically and cannot be changed manually.

Procedure

...

       1.      In the Web Dynpro Explorer, choose context menu entry Open Message Editor from the Message Pool component sub node.

       2.      Add a new message, and make the required entries.

Note

In the message key no space character is allowed. You can plug several words together without separation sign (e.g. MyErrorMessage). However, when you call the message key in your coding, you will find the available message keys in a converted form: the words appear in capital letters and are separated by a “_” (for example, MY_ERROR_MESSAGE).

For message type Text you can choose whether or not the message needs to be translated.

       3.      To edit, copy, paste or delete a message, use the context menu of the message.

Result

Interface IMessage<WDComponent>.java in the target folder contains the keys of the defined messages as constants.

Messages of type Text are of type IWDText. Messages of all other types are of type IWDMessage.

End of Content Area