Ansicht
Dokumentation

ABENMESSAGE_INTERFACE_ABEXA - MESSAGE INTERFACE ABEXA

ABENMESSAGE_INTERFACE_ABEXA - MESSAGE INTERFACE ABEXA

CL_GUI_FRONTEND_SERVICES - Frontend Services   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

- IF_T100_MESSAGE in a Local Exception Class

This example demonstrates how a local exception class is linked with a message

Source Code

Execute

Description

The functional method meth raises an exception from the local exception class cx_t100 that implements the interface IF_T100_MESSAGE. When the exception is raised, the constructor is given a message class, a message number, and values for the placeholders of the message.

The constructor of the local exception class cx_t100 fills the attribute T100KEY of the interface IF_T100_MESSAGE with the values passed. In this way, the exception class represents the passed message from the table T100 in which the placeholders "&" are replaced with the content of the attributes text1 to text4.

The method main catches the exception in the reference variable oref and indicates the following:

  • The exception text can be obtained using the method GET_TEXT of the component interface IF_MESSAGE in the interface IF_T100_MESSAGE. The implementation of the method GET_TEXT is in the superclass CX_ROOT, which already includes the interface IF_MESSAGE.
  • The reference variable can be used directly as an operand of the statement MESSAGE.

See also the executable examples listed below.






Fill RESBD Structure from EBP Component Structure   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 2107 Date: 20240427 Time: 055236     sap01-206 ( 39 ms )