只要将ICON的名字或ID传送到SELECTION-SCREEN COMMENT中,就可以在选择画面中显示ICON图标。
ICON的ID和名字可以在type pool ICON中得到:
也可以通过表ICON看到图标的样子
代码如下:
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 = '@0A@'.
显示结果:
以上。
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/19265.html