Hi You,
are you talking about any standard message or any custom messages.
Please can you explain.
If it is a custom message, then you can use like this, then you will not have any problem
MESSAGE 'your custom message' TYPE 'I'.
LEAVE TO TRANSACTION 'transaction code'.
or you an also use
MESSAGE 'your custom message' TYPE 'W' DISPLAY LIKE 'E'.
LEAVE TO SCREEN sy-dynnr.