ABAP顾问
分类:
2008-04-10 17:22:23
v41dugu 发表时间:2008-04-10 13:13:25 | |
请问 在selection screen里面,的push button , 怎么加入icon ? |
v41dugu 发表时间:2008-04-10 09:44:30 | |
请问一下screen里的push button, 可不可以在程序运行的时候 动态的决定button的 Icon |
SELECTION-SCREEN里面的Button改Icon方法如下程序.包括捕获事件以及如何做弹出方式的Screen(CALL SELECTION-SCREEN).
在Screen里面添加的Button,见:http://blog.chinaunix.net/u1/40527/showart_1097110.html.
REPORT z_barry_button_test4 .
TABLES: spfli,sscrfields.
SELECTION-SCREEN FUNCTION KEY 1."工具栏按钮,最多5个
SELECTION-SCREEN FUNCTION KEY 2.
SELECT-OPTIONS sel0 FOR sy-tabix.
PARAMETERS par0(5).
*SELECTION-SCREEN SKIP.
SELECTION-SCREEN PUSHBUTTON 46(12) p_butt1 USER-COMMAND pb01.
SELECTION-SCREEN BEGIN OF SCREEN 123 AS WINDOW TITLE text-456.
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-bl1
NO INTERVALS.
SELECT-OPTIONS sel1 FOR sy-subrc.
PARAMETERS par1 LIKE spfli-carrid.
SELECTION-SCREEN COMMENT /10(20) text-com.
SELECTION-SCREEN END OF BLOCK bl1.
SELECTION-SCREEN END OF SCREEN 123.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN BEGIN OF SCREEN 99.
SELECTION-SCREEN PUSHBUTTON 15(25) p_butt USER-COMMAND us01.
SELECT-OPTIONS sel2 FOR spfli-connid.
PARAMETERS par2 TYPE i.
SELECTION-SCREEN END OF SCREEN 99.
INITIALIZATION.
p_butt = @ 按下试试' .
p_butt1 = @ 测试'.
sscrfields-functxt_01 = @ TEST B1'.
sscrfields-functxt_02 = @ TEST B2'.
AT SELECTION-SCREEN.
CASE sy-ucomm . " sy-dynnr sscrfields-ucomm
WHEN 'FC01'.
CALL SELECTION-SCREEN 123 STARTING AT 10 5.
WHEN 'FC02'.
CALL SELECTION-SCREEN 99 STARTING AT 10 5 .
WHEN 'US01'.
MESSAGE i000(z900) WITH 'User Button' sy-dynnr.
WHEN 'PB01'.
MESSAGE i000(z900) WITH 'Push Button' sy-dynnr.
ENDCASE.