Did you raise the errors with the provided macros like:
include mm_messages_mac.
* (...)
if<some test>.
im_item->invalidate().
mmpur_metafield mmmfd_matnr.
mmpur_message_forced 'E''ZFSM''123' ls_item-matnr ls_item-werks space space.
endif.
Regards,
Raymond