Koffermaxe
10/24/2017 - 7:47 AM

Example of how a message class should be called

Example of how a message class should be called

DATA lv_message TYPE ehfnd_string.

MESSAGE e260(ehfnd_reg_list_msg) INTO lv_message.
add_sys_msg( ).
METHOD add_sys_msg.
* Purpose: This method adds a system message to the global
* table with all messages

*--------------------------------------------------------------------*
* Declarations
*--------------------------------------------------------------------*
  DATA: lr_msg TYPE REF TO bal_s_msg.

*--------------------------------------------------------------------*
* Implementation
*--------------------------------------------------------------------*

  APPEND INITIAL LINE TO mt_messages REFERENCE INTO lr_msg.
  lr_msg->msgty = sy-msgty.
  lr_msg->msgid = sy-msgid.
  lr_msg->msgno = sy-msgno.
  lr_msg->msgv1 = sy-msgv1.
  lr_msg->msgv2 = sy-msgv2.
  lr_msg->msgv3 = sy-msgv3.
  lr_msg->msgv4 = sy-msgv4.

ENDMETHOD.