SAP MESSAGE INTERFACE GLOBAL ABEXA



Get Example source ABAP code based on a different SAP table
  


VX_EXA_ONLY

ABAP_MSG - IF_T100_MESSAGE in a Global Exception Class
This example demonstrates how a global exception class is linked with a message

ABAP_SOURCE_CODE
DEMO CL_DEMO_MESSAGE_OREF_GLOBAL

ABAP_DESCRIPTION
This example works in the same way as the executable example in System Interface IF_T100_MESSAGE in a Local Exception Class. Here, however, the interface IF_T100_MESSAGE is included in the global exception class CX_DEMO_T100. The association with a message class was selected when the class was created. This specifies that the exception class is generated in such a way that it supports messages as exception texts, rather than merely including the interface IF_T100_MESSAGE.
On the tab Texts in the Class Builder, the message 888 from the message class SABAPDEMOS is assigned to the exception text DEMO of the exception class under Message Text. The placeholders of the message are linked with the attributes TEXT1 to TEXT4. The source code of the public section of the class implements this assignment using the structured constant DEMO with the type SCX_T100KEY. The constructor has an input parameter TEXTID that can be passed the constant DEMO and the input parameters TEXT1 to TEXT4 used to fill the identically named attributes.
A structure passed to the input parameter TEXTID when an exception from this class is raised is assigned to the structure T100KEY of the interface IF_T100_MESSAGE. This uses the corresponding message as an exception text. It is recommended that only the predefined constants of the class are passed, as shown here.
See also the executable examples listed below.
System Interface IF_T100_MESSAGE for Exception with Message
System Interface IF_T100_DYN_MSG in Global Exception Class