• 在屏幕上创建页签


    SAP允许直接通过ABAP代码在屏幕上创建一个页签,相关语法如下。

    SELECTION-SCREEN BEGIN OF TABBED BLOCK <block> FOR n LINES.

    每个页签都是由一个单独的子屏幕控制,N代表分页控件的高度,屏幕载入时必须先通过INITIALIZATION事件对其属性初始化。下例中将定义一个包含两个页签的TAB控件,代码所下所示。

     1 REPORT ztest_sum.
     2 
     3 TABLES:mara.
     4 *TABLES sscrfields.  "引用屏幕字段属性
     5 
     6 SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN .          "定义子屏幕100
     7 SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
     8 SELECT-OPTIONS:mat1 FOR mara-matnr NO INTERVALS.
     9 SELECTION-SCREEN SKIP 1.
    10 PARAMETERS: chk1 AS CHECKBOX DEFAULT 'X'.
    11 SELECTION-SCREEN END OF BLOCK a1.
    12 SELECTION-SCREEN END OF SCREEN 100.
    13 
    14 SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
    15 PARAMETERS:mat2 LIKE mara-matnr.
    16 SELECTION-SCREEN END OF SCREEN 200.
    17 
    18 *定义一个TAB空间,取名MYTAB,空间高为5,共分为两个页签BUTTON1/BUTTON2
    19 *两个页签的功能代码分别为PUSH1/PUSH2
    20 
    21 SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 5 LINES,
    22   TAB (20) button1 USER-COMMAND push1,
    23   TAB (20) button2 USER-COMMAND push2,
    24                   END OF BLOCK mytab.
    25 
    26 *为TAB控件分别初始化值,应用于TEXT ELEMENT文本
    27 INITIALIZATION.
    28   button1 = text-010.
    29   button2 = text-020.
    30   mytab-prog = sy-repid.
    31   mytab-dynnr = 100.
    32 
    33 AT SELECTION-SCREEN.
    34   CASE sy-ucomm.
    35     WHEN 'PUSH1'.
    36       mytab-dynnr = 100.
    37     WHEN 'PUSH2'.
    38       mytab-dynnr = 100.
    39     WHEN OTHERS.
    40   ENDCASE.

    执行结果如下

  • 相关阅读:
    终极调试工具EventRecorder使用方法,各种Link通吃
    stm32如何才能正常运行的调试笔记
    自己常用的vscode的插件备忘录
    linux下(lubuntu18.04.4)安装tinycc编译器及运行调试C语言
    虚拟机下的lubuntu14.04磁盘扩展
    使用lubuntu14.04编译ESP8266_NONOS_SDK3.0.0
    c语言中不建议使用的库函数
    RS485, RS422 and RS232连线
    Sql server output 功能介绍
    句子成分:主谓宾等
  • 原文地址:https://www.cnblogs.com/caizjian/p/3705787.html
Copyright © 2020-2023  润新知