ABAP 选择屏幕创建标签页

*&---------------------------------------------------------------------*
*& Report ZTEST_TAB
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------* REPORT ZTEST_TAB.
TABLES MARA.
"定义子屏幕 100
SELECTION-SCREEN BEGIN OF SCREEN AS SUBSCREEN.
SELECT-OPTIONS: S_FG1 FOR MARA-MATNR.
SELECTION-SCREEN END OF SCREEN . SELECTION-SCREEN BEGIN OF SCREEN AS SUBSCREEN.
SELECT-OPTIONS: S_FG2 FOR MARA-MATNR.
SELECTION-SCREEN END OF SCREEN . SELECTION-SCREEN BEGIN OF SCREEN AS SUBSCREEN.
SELECT-OPTIONS: S_RAW FOR MARA-MATNR.
SELECTION-SCREEN END OF SCREEN . "定义一个TAB空间, 取名为MYTAB, 控件高2行, 共分为三个页签.
"三个页签的功能代码分别为push1, push2, push3.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK MYTAB FOR LINES,
TAB () BUTTON1 USER-COMMAND PUSH1,
TAB () BUTTON2 USER-COMMAND PUSH2,
TAB () BUTTON3 USER-COMMAND PUSH3,
END OF BLOCK MYTAB. "为TAB控件分配初始化值 INITIALIZATION.
BUTTON1 = TEXT-.
BUTTON2 = TEXT-.
BUTTON3 = TEXT-.
MYTAB-PROG = SY-REPID.
MYTAB-DYNNR = . "为控件页签单击事件, 选择不同页签显示不同子屏幕. AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'PUSH1'.
MYTAB-DYNNR = .
MYTAB-ACTIVETAB = 'BUTTON1'.
WHEN 'PUSH2'.
MYTAB-DYNNR = .
MYTAB-ACTIVETAB = 'BUTTON2'.
WHEN 'PUSH3'.
MYTAB-DYNNR = .
MYTAB-ACTIVETAB = 'BUTTON3'.
ENDCASE. "处理各个屏幕的触发 START-OF-SELECTION.
IF MYTAB-DYNNR = .
* PERFORM GET_FG1.
ELSEIF MYTAB-DYNNR = .
* PERFORM GET_FG2.
ELSEIF MYTAB-DYNNR = .
* PERFORM GET_MATNR.
ENDIF.
上一篇:12月16日广州.NET俱乐部下午4点爬白云山活动


下一篇:.NET的未来-广州.NET俱乐部学生分会