需要首先创建一个屏幕,在屏幕中加一个Sub Screen控件,示例代码如下:
本例中创建了一个屏幕100,子屏幕控件为subscreen_1010,并在屏幕100的PAI和PBO中call subscreen 即可。
report zselectionscreen.
TABLES: mara.
* Custom Selection Screen 1010
SELECTION-SCREEN BEGIN OF SCREEN 1010 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X',
p_rad2 RADIOBUTTON GROUP grp1,
p_rad3 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS: s_matnr FOR mara-matnr,
s_matkl FOR mara-matkl,
s_mtart FOR mara-mtart.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 1010.
**********************************************************************
START-OF-SELECTION.
CALL SCREEN 100.
**********************************************************************
* &---------------------------------------------------------------------
*& Module STATUS_0100 OUTPUT
* &---------------------------------------------------------------------
MODULE status_0100 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE. "
*&---------------------------------------------------------------------
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------
MODULE user_command_0100 INPUT.
ENDMODULE.
**********************************************************************
* Screen screen 100 with a subscreen area
* called "subscreen_1010"
* Screen Flow Logic follows
process before output.
MODULE status_0100.
CALL subscreen subscreen_1010
including sy-repid '1010'.
process after input.
CALL subscreen subscreen_1010 .
MODULE user_command_0100.