Skip to content

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

IF_T100_DYN_MSG for Exception error_message

This example demonstrates how a caught message of a function module is forwarded.

Other versions: 7.31 | 7.40 | 7.54

Source Code

            message_type  = 'A'
            message_place = 'in Function Module'
            message_event = 'START-OF-SELECTION'
            error_message = 4.
        IF sy-subrc <> 0.
          RAISE EXCEPTION TYPE cx_demo_dyn_t100
            MESSAGE ID sy-msgid
            TYPE sy-msgty
            NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      CATCH cx_demo_dyn_t100 INTO DATA(oref).
          |Caught exception:\n\n| &&
          |"{ oref->get_text( ) }", Type { oref->msgty } | ).
        MESSAGE oref TYPE 'I' DISPLAY LIKE oref->msgty.


This example works in basically the same way as the executable example when transforming a classic exception raised using MESSAGE RAISING to a class-based exception. Here, however, a message of type A caught using error_message is transformed.


See also the executable example for using a short form of statement RAISE EXCEPTION MESSAGE.