最近有点空闲时间,把搜索帮助 、下拉框 、程序计时的功能整理到了一起做成一个DEMO,供学习和工作使用。其中搜索帮助和下拉框有自动联动的效果,有个搜索帮助的函数和一前使用的不一样,还有计时的功能用到的时候比较少但是比较好玩。话不多说直接上干货。
选择屏幕按钮
源程序:
TYPE-POOLS: vrm,abap.
DATA: go_time TYPE REF TO cl_gui_timer.
PARAMETERS: p_01 RADIOBUTTON GROUP rg01 DEFAULT 'X' USER-COMMAND rg,
p_02 RADIOBUTTON GROUP rg01,
p_03 RADIOBUTTON GROUP rg01.
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECTION-SCREEN:BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 1(18) text-001 MODIF ID m01. "Shipping Conditions
PARAMETERS p_vsbed LIKE likp-vsbed MODIF ID m01.
PARAMETERS p_vtext LIKE tvsbt-vtext MODIF ID m01.
SELECTION-SCREEN POSITION 40 .
SELECTION-SCREEN:END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
PARAMETER: p_werks TYPE t001w-werks AS LISTBOX VISIBLE LENGTH 4 MODIF ID m02 USER-COMMAND lb,
p_name1 TYPE t001w-name1 MODIF ID m02.
CLASS cl_event_handler DEFINITION.
PUBLIC SECTION.
***方法声明
METHODS : run_handler FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "cl_event_handler DEFINITION
CLASS cl_event_handler IMPLEMENTATION.
***定时方法
METHOD run_handler.
go_time->cancel( ).
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'EXIT'.
ENDMETHOD. "run_handler
ENDCLASS. "cl_event_handler IMPLEMENTATION
DATA: go_handler T