Skip to Content
Technical Articles

Display Icon | Image in Messages for ITS MOBILE

Recently I have come across a requirement to display Icon along with Message type. I have used FM ‘ICON_CREATE’ to display ICON with message type for its respective message type. But, this solution only works in SAP GUI not in ITS Mobile.

To display image in ITS Mobile, we need to add the image tag from INCLUDE/MESGS from ITSMOBILE Service.

`<img class="MobileMessageLogo" src="`mimeURL(~service="itsmobile", ~theme=99, ~language="", ~name=mymessageimg)`" `sh()`>`

 

My Requirement is display Error image/icon for error message type and Success image/icon for success message type.

                                       

 

Code Required:

As I am populating message types from back-end, we need to write below mentioned code in HTML Template for the screen before displaying the message type.

`if( 'LV_MESSAGE_TYPE'[1] == "Error" )  
 mymessageimg = "images/all/error.gif";
else
mymessageimg  = "images/all/enter.gif";
end`

Variable ‘mymessageimg’ will have respective image based on the message type from the program.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.