Show TOC

Object messagesLocate this document in the navigation structure

Definition

The object messages has the same type as class CL_BSP_MESSAGES . This object is a message container and outputs different types of error messages. It contains a list of error messages with details of severity, condition, and the corresponding text.

Use

You use the object to handle users' incorrect entries in BSP applications. For more information, see Handling Incorrect Input .

An entry is made in the list if syntax errors occur in automatic page attributes, for example, when the entry cannot be converted to a specific format. The attribute name must be available.

You can add additional entries to the messages object during input processing . Texts and conditions are user-definable in this case.

Structure

The following methods are available:

  • NUM_MESSAGES

    This method returns the number of messages when it is called.

  • ADD_MESSAGE

    This method adds a single message when it is called.

  • GET_MESSAGE

    This method returns the requested message when it is called.

  • ASSERT

    This method returns the message index for a specific condition or 0 when it is called.

  • ASSERT_SEVERITY

    This method returns the severity of the error for a specific condition or 0 when it is called.

  • ASSERT_MESSAGE

    This method returns the message for a specific condition or an empty string when it is called.

The conditions specify the message types or error levels. The following error levels are available:

Attribute Name

Initial Value

Description of Error Level

CO_SEVERITY_ERROR

2

Normal error

CO_SEVERITY_FATAL_ERROR

1

Fatal error

CO_SEVERITY_INFO

4

Information

CO_SEVERITY_SUCCESS

5

Success message

CO_SEVERITY_WARNING

3

Warning

The messages are grouped together in a table (attribute M_MESSAGES ).

Example

There is an example showing the use of this object in the SAP System in the BSP application bsptutorialmessages , in the package SBSP_DOCU .