效果图如下:
- QALS添加客制化字段。
- CMOD创建增强实施。
根据不同的检验类型,显示不同的屏幕信息。
全局变量定义:
TABLES: qals_cust.
CONSTANTS: BEGIN OF C_TABS,
TAB1 LIKE SY-UCOMM VALUE 'TAB1',
TAB2 LIKE SY-UCOMM VALUE 'TAB2',
TAB3 LIKE SY-UCOMM VALUE 'TAB3',
TAB4 LIKE SY-UCOMM VALUE 'TAB4',
TAB5 LIKE SY-UCOMM VALUE 'TAB5',
TAB6 LIKE SY-UCOMM VALUE 'TAB6',
TAB7 LIKE SY-UCOMM VALUE 'TAB7',
END OF C_TABS.
*&SPWIZARD: DATA FOR TABSTRIP 'TABS'
CONTROLS: TABS TYPE TABSTRIP.
DATA: BEGIN OF G_TABS,
SUBSCREEN LIKE SY-DYNNR,
PROG LIKE SY-REPID VALUE 'SAPLXQPL',
PRESSED_TAB LIKE SY-UCOMM VALUE C_TABS-TAB1,
END OF G_TABS.
DATA: OK_CODE LIKE SY-UCOMM.
DATA: g_display TYPE c.
data:gs_qals type qals .
实现方法:
EXIT_SAPLQPL1_004:系统数据传输到屏幕
DATA: l_trtyp LIKE t160-trtyp,
l_fs_c(30) TYPE c VALUE '(SAPLQPL1)G_T185F_AKTI'.
FIELD-SYMBOLS: <l_fs>.
ASSIGN (l_fs_c) TO <l_fs>.
IF sy-subrc = 0.
l_trtyp = <l_fs>.
CASE l_trtyp.
WHEN 'A'.
g_display = 'X'.
WHEN OTHERS.
g_display = ''.
ENDCASE.
ENDIF.
MOVE-CORRESPONDING i_qals TO qals_cust.
MOVE-CORRESPONDING i_qals to gs_qals .
EXIT_SAPLQPL1_006:屏幕数据传回系统。
MOVE-CORRESPONDING qals_cust TO e_qals_cust.
e_active = 'X'.
100屏幕
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE TABS_ACTIVE_TAB_SET.
CALL SUBSCREEN:
SUBarea INCLUDING G_TABS-PROG G_TABS-SUBSCREEN.
PROCESS AFTER INPUT.
CALL SUBSCREEN:
SUBarea .
MODULE TABS_ACTIVE_TAB_GET.
* MODULE USER_COMMAND_0100.
CODE:
MODULE STATUS_0100 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
LOOP AT SCREEN.
IF GS_QALS-ART EQ 'J61' OR GS_QALS-ART EQ 'J91'.
IF SCREEN-NAME EQ 'TAB2' OR SCREEN-NAME EQ 'TAB3' OR SCREEN-NAME EQ 'TAB4' OR
SCREEN-NAME EQ 'TAB5' OR SCREEN-NAME EQ 'TAB6' OR SCREEN-NAME EQ 'TAB7' .
SCREEN-ACTIVE = 0 .
ENDIF .
ELSEIF GS_QALS-ART EQ 'J81'.
IF SCREEN-NAME EQ 'TAB1' OR SCREEN-NAME EQ 'TAB3' OR SCREEN-NAME EQ 'TAB4' OR
SCREEN-NAME EQ 'TAB5' OR SCREEN-NAME EQ 'TAB6' OR SCREEN-NAME EQ 'TAB7' .
SCREEN-ACTIVE = 0 .
ENDIF .
ELSEIF GS_QALS-ART EQ 'J82'.
IF SCREEN-NAME EQ 'TAB1' OR SCREEN-NAME EQ 'TAB2' OR SCREEN-NAME EQ 'TAB4' OR
SCREEN-NAME EQ 'TAB5' OR SCREEN-NAME EQ 'TAB6' OR SCREEN-NAME EQ 'TAB7' .
SCREEN-ACTIVE = 0 .
ENDIF .
ELSEIF GS_QALS-ART EQ 'J83'.
IF SCREEN-NAME EQ 'TAB1' OR SCREEN-NAME EQ 'TAB2' OR SCREEN-NAME EQ 'TAB3' OR
SCREEN-NAME EQ 'TAB5' OR SCREEN-NAME EQ 'TAB6' OR SCREEN-NAME EQ 'TAB7' .
SCREEN-ACTIVE = 0 .
ENDIF .
ELSEIF GS_QALS-ART EQ 'J85'.
IF SCREEN-NAME EQ 'TAB1' OR SCREEN-NAME EQ 'TAB2' OR SCREEN-NAME EQ 'TAB3' OR
SCREEN-NAME EQ 'TAB5' OR SCREEN-NAME EQ 'TAB6' OR SCREEN-NAME EQ 'TAB7' .
SCREEN-ACTIVE = 0 .
ENDIF .
ELSEIF GS_QALS-ART EQ 'J88'.
IF SCREEN-NAME EQ 'TAB1' OR SCREEN-NAME EQ 'TAB2' OR SCREEN-NAME EQ 'TAB3' OR
SCREEN-NAME EQ 'TAB4' OR SCREEN-NAME EQ 'TAB6' OR SCREEN-NAME EQ 'TAB7' .
SCREEN-ACTIVE = 0 .
ENDIF .
ELSEIF GS_QALS-ART EQ 'J62'.
IF SCREEN-NAME EQ 'TAB1' OR SCREEN-NAME EQ 'TAB2' OR SCREEN-NAME EQ 'TAB3' OR
SCREEN-NAME EQ 'TAB4' OR SCREEN-NAME EQ 'TAB5' OR SCREEN-NAME EQ 'TAB7' .
SCREEN-ACTIVE = 0 .
ENDIF .
ELSEIF GS_QALS-ART EQ 'J63'.
IF SCREEN-NAME EQ 'TAB1' OR SCREEN-NAME EQ 'TAB2' OR SCREEN-NAME EQ 'TAB3' OR
SCREEN-NAME EQ 'TAB4' OR SCREEN-NAME EQ 'TAB5' OR SCREEN-NAME EQ 'TAB6' .
SCREEN-ACTIVE = 0 .
ENDIF .
ELSE.
IF SCREEN-NAME EQ 'TAB1' OR SCREEN-NAME EQ 'TAB2' OR SCREEN-NAME EQ 'TAB3' OR
SCREEN-NAME EQ 'TAB4' OR SCREEN-NAME EQ 'TAB5' OR SCREEN-NAME EQ 'TAB6' OR SCREEN-NAME EQ 'TAB7' .
SCREEN-ACTIVE = 0 .
ENDIF .
ENDIF .
MODIFY SCREEN .
ENDLOOP .
ENDMODULE. " STATUS_0100 OUTPUT
*&SPWIZARD: OUTPUT MODULE FOR TS 'TABS'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: SETS ACTIVE TAB
MODULE TABS_ACTIVE_TAB_SET OUTPUT.
CASE GS_QALS-ART .
WHEN 'J61' .
G_TABS-PRESSED_TAB = 'TAB1' .
WHEN 'J91' .
G_TABS-PRESSED_TAB = 'TAB1' .
WHEN 'J81'.
G_TABS-PRESSED_TAB = 'TAB2' .
WHEN 'J82'.
G_TABS-PRESSED_TAB = 'TAB3' .
WHEN 'J83'.
G_TABS-PRESSED_TAB = 'TAB4' .
WHEN 'J83'.
G_TABS-PRESSED_TAB = 'TAB5' .
WHEN 'J88'.
G_TABS-PRESSED_TAB = 'TAB5' .
WHEN 'J62'.
G_TABS-PRESSED_TAB = 'TAB6' .
WHEN 'J63'.
G_TABS-PRESSED_TAB = 'TAB7' .
ENDCASE .
TABS-ACTIVETAB = G_TABS-PRESSED_TAB.
CASE G_TABS-PRESSED_TAB.
WHEN C_TABS-TAB1.
G_TABS-SUBSCREEN = '0101'.
WHEN C_TABS-TAB2.
G_TABS-SUBSCREEN = '0102'.
WHEN C_TABS-TAB3.
G_TABS-SUBSCREEN = '0103'.
WHEN C_TABS-TAB4.
G_TABS-SUBSCREEN = '0104'.
WHEN C_TABS-TAB5.
G_TABS-SUBSCREEN = '0105'.
WHEN C_TABS-TAB6.
G_TABS-SUBSCREEN = '0106'.
WHEN C_TABS-TAB7.
G_TABS-SUBSCREEN = '0107'.
WHEN OTHERS.
G_TABS-SUBSCREEN = '9999'.
*&SPWIZARD: DO NOTHING
ENDCASE.
ENDMODULE. "TABS_ACTIVE_TAB_SET OUTPUT
*&SPWIZARD: INPUT MODULE FOR TS 'TABS'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: GETS ACTIVE TAB
MODULE TABS_ACTIVE_TAB_GET INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN C_TABS-TAB1.
G_TABS-PRESSED_TAB = C_TABS-TAB1.
WHEN C_TABS-TAB2.
G_TABS-PRESSED_TAB = C_TABS-TAB2.
WHEN C_TABS-TAB3.
G_TABS-PRESSED_TAB = C_TABS-TAB3.
WHEN C_TABS-TAB4.
G_TABS-PRESSED_TAB = C_TABS-TAB4.
WHEN C_TABS-TAB5.
G_TABS-PRESSED_TAB = C_TABS-TAB5.
WHEN C_TABS-TAB6.
G_TABS-PRESSED_TAB = C_TABS-TAB6.
WHEN C_TABS-TAB7.
G_TABS-PRESSED_TAB = C_TABS-TAB7.
WHEN OTHERS.
*&SPWIZARD: DO NOTHING
ENDCASE.
ENDMODULE. "TABS_ACTIVE_TAB_GET INPUT
使用下图按钮添加TABS页签: