Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Text Repositories →  Messages →  System Interfaces for Messages 

System Interface IF_T100_DYN_MSG for Messages

The interface IF_T100_DYN_MSG contains the interface IF_T100_MESSAGE as a component interface and adds the following to it:

  • The attribute MSGTY for the message type
  • The attributes MSGV1 to MSGV4 for the placeholders of the message

Like IF_T100_MESSAGE, the interface IF_T100_DYN_MSG associates classes with messages, with the attributes for the message type and placeholders of the message being predefined.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • The interface IF_T100_DYN_MSG is designed specifically for raising class-based exceptions with the addition MESSAGE of the statement RAISE EXCEPTION or the addition THROW in conditional expressions. The properties of the message specified after MESSAGE are assigned automatically to the associated attributes in exception classes that include IF_T100_DYN_MSG.

  • The addition MESSAGE to RAISE EXCEPTION and/or THROW has a short form USING MESSAGE. This can be used for exception classes with the interface IF_T100_DYN_MSG and enables determining the message from the current content of system fields sy-msg.... The short form can be used for transforming classical exceptions in class-based exceptions.

  • If the object reference variable oref points to an object that includes the system interface IF_T100_DYN_MSG in the variant MESSAGE oref of the statement MESSAGE, the addition TYPE can be omitted and the message type from the interface attribute MSGTY of the object is used implicitly.

Example

Uses THROW to raise an exception of the class CX_DEMO_DYN_T100, which binds the interface IF_T100_DYN_MSG.

DATA col TYPE c LENGTH 1. 

... 

DATA(color) = COND string( 
               WHEN col = 'R' THEN 'red' 
               WHEN col = 'B' THEN 'blue' 
                WHEN col = 'G' THEN 'green' 
                ELSE THROW cx_demo_dyn_t100( 
                     MESSAGE e888(sabapdemos) 
                       WITH 'Illegal value:' col ) ). 

Executable Examples

Continue

IF_T100_DYN_MSG in a Regular Class

IF_T100_DYN_MSG in a Local Exception Class

IF_T100_DYN_MSG in a Global Exception Class

IF_T100_DYN_MSG for Exception error_message