TAB控件事件在Report程序中的定义及使用
Posted 独吊东南枝
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了TAB控件事件在Report程序中的定义及使用相关的知识,希望对你有一定的参考价值。
TABLES:mara.
*定义子屏幕100
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:mat1 FOR mara-matnr NO INTERVALS.
SELECTION-SCREEN SKIP 1.
PARAMETERS:chk1 AS CHECKBOX DEFAULT ‘X‘.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN END OF SCREEN 100.
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
PARAMETERS:mat2 LIKE mara-matnr.
SELECTION-SCREEN END OF SCREEN 200.
*定义一个TAB控件,取名为MYTAB,控件高为5,共分两个选项卡BUTTON1、BUTTON2
*两个选项卡的功能代码分别为PUSH1、PUSH2
SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 5 LINES,
TAB (20) button1 USER-COMMAND push1,
TAB (20) button2 USER-COMMAND push2,
END OF BLOCK mytab.
*为TAB控件分配初始化值,应用text element定义文本
INITIALIZATION.
button1 = text-010.
button2 = text-020.
mytab-prog = sy-repid.
mytab-dynnr = 100.
*TAB控件选项卡单击事件,选择不同选项卡显示不同子屏幕
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN ‘PUSH1‘.
mytab-dynnr = 100.
mytab-activetab = ‘BUTTON1‘.
WHEN ‘PUSH2‘.
mytab-dynnr = 200.
mytab-activetab = ‘BUTTON2‘.
ENDCASE.
以上是关于TAB控件事件在Report程序中的定义及使用的主要内容,如果未能解决你的问题,请参考以下文章