Using SAP ICONs(e.g. magnifying glass, display glass icon etc) in CRM Webui
Recently i have a requirement to use this standard magnifying glass and display icon as one click action in Action column of a table/tree view .
So i would like to share this information how i implemented that.
This information below explains about how to access the SAP standard ICONS in webui.
There is a standard table ICON, which contains all the standard sap (GUI) icons.
Screenshot of ICON table.
In class CL_BSP_MIMES , static method SAP_ICON which returns the icon .
This method takes the ID of the icon and returns the icon as string .
Steps to use:
1.Go to Table ICON selection screen.
2.Do F4 in field ID, it will display list of icons from ICON table.
3.Then choose the entry required.
4,it will display the technical id of the icon in the ID input field.
5.then pass this technical id into the method CL_BSP_MIMES=>SAP_ICON( id = <technical id of icon> ).
For example: For using the standard icon magnifying glass( Choose Details) or Display icon, you can do the below.
– Follow the steps from 1 to 4 as per below screenshot.
– Now call this static method in your program as below.
data: l_f_icon type string.
constants: l_c_detail_icon_id type string value ‘@16@’,
l_c_display_icon type string value ‘@10@’. “ICON_DISPLAY
l_f_icon = cl_bsp_mimes=>sap_icon( id = l_c_detail_icon_id ).
This value you can pass to your webui button codings.
-For ONE CLICK ACTION buttons:
Data: l_s_one_click_action type crmt_thtmlb_one_click_action.
l_s_one_click_action-icon = cl_bsp_mimes=>sap_icon( id = l_c_detail_icon_id ).
-For Toolbar Buttons:
DATA: l_s_button TYPE crmt_thtmlb_button.
l_s_button-icon_src = cl_bsp_mimes=>sap_icon( id = l_c_detail_icon_id ).
Also if you execute this static method you can see the Mime path by passing the ID of the icon.
Also you can explore the other methods in this class CL_BSP_MIMES. It has package SBSP_MIMES
Hope this information helpful .