Step 1:设计一个主屏幕,放置一个”子屏幕范围”
屏幕的逻辑流为:
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN sa_2200_1 INCLUDING sy-repid '2220'.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
CALL SUBSCREEN sa_2200_1.
MODULE USER_COMMAND_0100 INPUT.
DATA lv_return_code TYPE i.
CLEAR save_ok.
save_ok = ok_code.
CLEAR ok_code.
CLEAR gv_processed.
CALL METHOD cl_gui_cfw=>dispatch
IMPORTING
return_code = lv_return_code.
CHECK lv_return_code = cl_gui_cfw=>rc_noevent.
CASE save_ok.
WHEN 'PB_2220_1' OR 'PB_2220_2' OR 'PB_2240_1' OR 'PB_2240_2' OR
'PB_2260_1' OR 'PB_2260_2' OR 'PB_2280_1' OR 'PB_2280_2'.
PERFORM set_the_col_area_screen.
WHEN others.
* action code from the menus will be processed here.
PERFORM get_screen_number USING save_ok.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Form set_the_col_area_screen
*&---------------------------------------------------------------------*
* This subroutine is used to set the subscreen for the collapsible
* areas
*----------------------------------------------------------------------*
FORM set_the_col_area_screen .
CASE save_ok.
WHEN 'PB_2220_1' OR 'PB_2260_2'. "打开下半部展开的子屏幕
gv_subscreen_2200_1 = 2280.
WHEN 'PB_2220_2' OR 'PB_2260_1'. "打开上半部展开的子屏幕
gv_subscreen_2200_1 = 2240.
WHEN 'PB_2240_1' OR 'PB_2280_2'. "打开全关闭的子屏幕
gv_subscreen_2200_1 = 2260.
WHEN 'PB_2280_1' OR 'PB_2240_2'. "打开全打开的子屏幕
gv_subscreen_2200_1 = 2220.
ENDCASE.
ENDFORM. " set_the_col_area_screen
Step 2: 最底层的两个信息子屏幕
屏幕(2290)
PROCESS BEFORE OUTPUT.
*
PROCESS AFTER INPUT.
屏幕(2230)
逻辑流
PROCESS BEFORE OUTPUT.
*
PROCESS AFTER INPUT.
Step 3: 定义全展示子屏幕 (2220)
第一个按钮的功能码:PB_2220_1
第一个按钮的功能码:PB_2220_2
屏幕逻辑流
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN SA_2220_1 including sy-repid '2290'.
CALL SUBSCREEN SA_2220_2 including sy-repid '2300'.
*
PROCESS AFTER INPUT.
CALL SUBSCREEN SA_2220_1.
CALL SUBSCREEN SA_2220_2.
Step 4:定义上半部展开的子屏幕(2240)
第一个按钮的功能码:PB_2240_1
第一个按钮的功能码:PB_2240_2
屏幕逻辑流
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN SA_2240_1 including sy-repid '2290'.
*
PROCESS AFTER INPUT.
CALL SUBSCREEN SA_2240_1.
Step 5:定义下半部展开的子屏幕(2280)
第一个按钮的功能码:PB_2280_1
第一个按钮的功能码:PB_2280_2
屏幕逻辑流
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN SA_2280_2 including sy-repid '2300'.
*
PROCESS AFTER INPUT.
CALL SUBSCREEN SA_2280_2.
Step 6:定义全关闭的子屏幕(2260)
第一个按钮的功能码:PB_2260_1
第一个按钮的功能码:PB_2260_2
屏幕逻辑流
PROCESS BEFORE OUTPUT.
*
PROCESS AFTER INPUT.