DIALOG TAB标签控件,子屏幕的使用
程序员文章站
2022-05-30 23:41:00
...
使用TAB 页签,可是实现一个屏幕上多个ALV之间的切换,在每一个TAB页签中植入子屏幕
一、Dialog 标签条(含向导)控件
1.启动,继续
2.设置标签条的名称
3.设置每一个TAB页签的名称
4. 为每一个TAB页签设置功能代码,供功能使用
4.分配数据定义,PBO,PAI 模块,自己定义的include文件 (这里是TOP ,O01,I01)
5.分配完成
二、 相关数据定义,每一个TAB页签的功能码定义
*&SPWIZARD: FUNCTION CODES FOR TABSTRIP 'COMP_RECRUIT'
CONSTANTS: BEGIN OF C_COMP_RECRUIT,
TAB1 LIKE SY-UCOMM VALUE 'COMP_RECRUIT_FC1',
TAB2 LIKE SY-UCOMM VALUE 'COMP_RECRUIT_FC2',
TAB3 LIKE SY-UCOMM VALUE 'COMP_RECRUIT_FC3',
END OF C_COMP_RECRUIT.
*&SPWIZARD: DATA FOR TABSTRIP 'COMP_RECRUIT'
CONTROLS: COMP_RECRUIT TYPE TABSTRIP.
DATA: BEGIN OF G_COMP_RECRUIT,
SUBSCREEN LIKE SY-DYNNR,
PROG LIKE SY-REPID VALUE 'ZGJX_BY_COMPANY_RECRUIT',
PRESSED_TAB LIKE SY-UCOMM VALUE C_COMP_RECRUIT-TAB1,
END OF G_COMP_RECRUIT.
三、PBO,CALL SUBSCREEN,传入参数
Variant 1
CALL SUBSCREEN sub_area INCLUDING prog dynnr.
sub_area:子屏幕名称
prog :当前程序
dynnr:子屏幕
PROCESS BEFORE OUTPUT.
*&SPWIZARD: PBO FLOW LOGIC FOR TABSTRIP 'COMP_RECRUIT'
MODULE COMP_RECRUIT_ACTIVE_TAB_SET.
CALL SUBSCREEN COMP_RECRUIT_SCA
INCLUDING G_COMP_RECRUIT-PROG G_COMP_RECRUIT-SUBSCREEN.
*
*&SPWIZARD: OUTPUT MODULE FOR TS 'COMP_RECRUIT'. DO NOT CHANGE THIS LINE
*&SPWIZARD: SETS ACTIVE TAB
MODULE COMP_RECRUIT_ACTIVE_TAB_SET OUTPUT.
COMP_RECRUIT-ACTIVETAB = G_COMP_RECRUIT-PRESSED_TAB.
CASE G_COMP_RECRUIT-PRESSED_TAB.
WHEN C_COMP_RECRUIT-TAB1.
G_COMP_RECRUIT-SUBSCREEN = '0110'.
WHEN C_COMP_RECRUIT-TAB2.
G_COMP_RECRUIT-SUBSCREEN = '0120'.
WHEN C_COMP_RECRUIT-TAB3.
G_COMP_RECRUIT-SUBSCREEN = '0130'.
WHEN OTHERS.
*&SPWIZARD: DO NOTHING
四、PAI ,根据每一个TAB页签的功能代码,改变 G_COMP_RECRUIT-PRESSED_TAB的值,CALL SCREEN
PROCESS AFTER INPUT.
*&SPWIZARD: PAI FLOW LOGIC FOR TABSTRIP 'COMP_RECRUIT'
CALL SUBSCREEN COMP_RECRUIT_SCA.
MODULE COMP_RECRUIT_ACTIVE_TAB_GET.
*&SPWIZARD: INPUT MODULE FOR TS 'COMP_RECRUIT'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: GETS ACTIVE TAB
MODULE COMP_RECRUIT_ACTIVE_TAB_GET INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN C_COMP_RECRUIT-TAB1.
G_COMP_RECRUIT-PRESSED_TAB = C_COMP_RECRUIT-TAB1.
WHEN C_COMP_RECRUIT-TAB2.
G_COMP_RECRUIT-PRESSED_TAB = C_COMP_RECRUIT-TAB2.
WHEN C_COMP_RECRUIT-TAB3.
G_COMP_RECRUIT-PRESSED_TAB = C_COMP_RECRUIT-TAB3.
WHEN OTHERS.
*&SPWIZARD: DO NOTHING
ENDCASE.
ENDMODULE.