Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
retired_member
Product and Topic Expert
Product and Topic Expert
5,486
With ABAP 7.50, a new interface IF_T100_DYN_MSG was introduced that enriched the existing IF_T100_Message with

 

  • an attribute MSGTY for the message type



  • and attributes MSGV1 to MSGV4 for the placeholders of the message.


Using that interface some colleagues soon found a small gap:
TRY.
...
CATCH cx_demo_dyn_t100 INTO DATA(oref).
MESSAGE oref TYPE oref->if_t100_dyn_msg~msgty.
ENDTRY.

If you catch an exception where the exception class implements IF_T100_DYN_MSG and you want to send the respective message with the message type stored in the attribute MSGTY, well, why should you name it explicitly?

This was resolved with ABAP 7.51. If oref of the statement variant MESSAGE oref points to an object that implements the system interface IF_T100_DYN_MSG, the addition TYPE can be omitted and the message type in MSGTY is used:
TRY.
...
CATCH cx_demo_dyn_t100 INTO DATA(oref).
MESSAGE oref.
ENDTRY.

And that's all about that.

For more information see MESSAGE - msg.
Labels in this area