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.
7.31 | 7.40 | 7.54
- The interface IF_T100_DYN_MSG is designed specifically for raising class-based exceptions with the
MESSAGEof the statement RAISE EXCEPTION or the addition
THROWin conditional expressions. The properties of the message specified after
MESSAGEare assigned automatically to the associated attributes in exception classes that include IF_T100_DYN_MSG.
- The addition
THROWhas 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.
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 ) ).