只要将ICON的名字或ID传送到SELECTION-SCREEN COMMENT中,就可以在选择画面中显示ICON图标。
ICON的ID和名字可以在type pool ICON中得到:
<img class="alignnone size-full wp-image-4979" src="//pic.ikafan.com/imgp/L3Byb3h5L2h0dHAvd3d3LmJhaWR1c2FwLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNy0wNy0xMF8xMC00MS01NC5wbmc=.jpg" width="768" height="558" srcset="http://www.baidusap.com/wp-content/uploads/2017-07-10_10-41-54.png 768w, http://www.baidusap.com/wp-content/uploads/2017-07-10_10-41-54-740x538.png 740w" sizes="(max-width: 768px) 100vw, 768px" />
也可以通过表ICON看到图标的样子
<img class="alignnone size-full wp-image-4980" src="//pic.ikafan.com/imgp/L3Byb3h5L2h0dHAvd3d3LmJhaWR1c2FwLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNy0wNy0xMF8xMC00NC00NS5wbmc=.jpg" width="676" height="425" />
代码如下:
REPORT ztest_display_icon. TYPE-POOLS: icon. *&---------------------------------------------------------------------* *& Selection screen *&---------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN COMMENT 1(15) g_text_1. SELECTION-SCREEN COMMENT 16(10) g_icon_1. PARAMETERS p_in TYPE pathextern. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN COMMENT 1(15) g_text_2. SELECTION-SCREEN COMMENT 16(10) g_icon_2. PARAMETERS p_out TYPE pathextern. SELECTION-SCREEN END OF LINE. *&---------------------------------------------------------------------* *& Initialization *&---------------------------------------------------------------------* INITIALIZATION. g_text_1 = ‘Excel Filename‘. **Pass Icon name g_icon_1 = icon_xls. g_text_2 = ‘Red Light‘. **Pass Icon ID g_icon_2 = ‘@[email protected]‘.
显示结果:
<img class="alignnone size-full wp-image-4985" src="//pic.ikafan.com/imgp/L3Byb3h5L2h0dHAvd3d3LmJhaWR1c2FwLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNy0wNy0xMF8xMC01Ny0yNy5wbmc=.jpg" width="398" height="161" />
以上。
原文地址:https://www.cnblogs.com/datie/p/11433843.html