ALV——选择屏幕选项卡

ALV选择屏幕选项卡

运行效果:

 

代码:

 

 

*&--------------------------------------------------------------------*
*& REPORT ZQMRTEST
*&--------------------------------------------------------------------*
*&
*&--------------------------------------------------------------------*
REPORT  ZQMRTEST.

TABLES: MARA,QALS,AFPO.

DATA: BEGIN OF GT_DATA OCCURS 0,
  PRUEFLOS LIKE QALS-PRUEFLOS,
  MSG TYPE STRING,
END OF GT_DATA.

*-->ALV
TYPE-POOLS SLIS.
DATA: GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
          GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.


SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
PARAMETERS: P_WERKS LIKE MARC-WERKS DEFAULT '2000' OBLIGATORY,
                    P_TYPE LIKE QALS-HERKUNFT DEFAULT '89' OBLIGATORY,
                    P_MATNR LIKE MARC-MATNR,
                    P_MENGE LIKE QALS-LOSMENGE,
                    P_KDAUF LIKE AFPO-KDAUF,
                    P_KDPOS LIKE AFPO-KDPOS.
SELECTION-SCREEN END OF SCREEN 100.

SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
PARAMETERS: P_WERKS2 LIKE MARC-WERKS DEFAULT '2000' OBLIGATORY,
                    P_TYPE2 LIKE QALS-HERKUNFT DEFAULT '89' OBLIGATORY,
                    P_MATNR2 LIKE MARC-MATNR,
                    P_MENGE2 LIKE QALS-LOSMENGE.
SELECTION-SCREEN END OF SCREEN 200.

"定义一个TAB空间, 取名为MYTAB, 控件高10行, 共分为二个页签.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK MYTAB FOR 10 LINES,
  TAB (25) BUTTON1 USER-COMMAND PUSH1,
  TAB (25) BUTTON2 USER-COMMAND PUSH2,
END OF BLOCK MYTAB.

************************************************************************
* INITIALIZATION
************************************************************************
"为TAB控件分配初始化值
INITIALIZATION.
  BUTTON1 = TEXT-010.
  BUTTON2 = TEXT-020.
  MYTAB-PROG = SY-REPID.
  MYTAB-DYNNR = 100.

************************************************************************
* AT SELECTION SCREEN
************************************************************************
  "为控件页签单击事件, 选择不同页签显示不同子屏幕.
AT SELECTION-SCREEN.
  CASE SY-UCOMM.
    WHEN 'PUSH1'.
      MYTAB-DYNNR = 100.
      MYTAB-ACTIVETAB = 'BUTTON1'.
    WHEN 'PUSH2'.
      MYTAB-DYNNR = 200.
      MYTAB-ACTIVETAB = 'BUTTON2'.
  ENDCASE.

  "处理各个屏幕的触发

************************************************************************
* AT SELECTION SCREEN OUTPUT
************************************************************************
AT SELECTION-SCREEN OUTPUT.

************************************************************************
* REPORT FORMAT
************************************************************************
TOP-OF-PAGE.

END-OF-PAGE.
************************************************************************
* MAIN PROCESS
************************************************************************
START-OF-SELECTION.
  
END-OF-SELECTION.

 

转载于:https://www.cnblogs.com/StephenAmell/p/11401575.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值