首页 > 代码库 > 子屏幕的创建

子屏幕的创建

SAP可以定义子屏幕,将所定义屏幕窗体作为一个新的对话框窗体来引用,子屏幕分为两种,一种为INCLUDE SCREEN,可以通过report端程序直接调用,另一种是subscreen,需要通过screen painter所创建引用,今天先写INCLUDE SCREEN

1.在子屏幕引用中可以通过参数来指定子屏幕的具体大小及位置,INCLUDE screen相关语法定义如下:

<style></style>

SELECTION-SCREEN BEGIN OF SCREEN scr.

 

<style></style>

SELECTION-SCREEN END OF SCREEN scr.

示例:

SELECTION-SCREEN BEGIN OF SCREEN 123 AS WINDOW TITLE text-a01.  "定义子屏幕123
PARAMETERS:matnr LIKE mara-matnr.
PARAMETERS: type AS CHECKBOX.
SELECTION-SCREEN END OF SCREEN 123.


CALL SCREEN 123
              STARTING AT 10 10    "指定子屏幕的大小和位置
              ENDING   AT 80 10.

效果如下图:

 

 

2.当一个主屏幕调用另外一个子屏幕时候必须使用 call selection-screen 的方法

REPORT ztest_sum.
TABLES:mara.
PARAMETERS: type AS CHECKBOX.

call selection-screen 123.

SELECTION-SCREEN BEGIN OF SCREEN 123 AS WINDOW TITLE text-a01.  "定义子屏幕123
PARAMETERS:matnr LIKE mara-matnr.
SELECTION-SCREEN END OF SCREEN 123.

效果如下点击运行

出现子屏幕如下: