ABAP—多页签SHEET、选项参数或block隐藏
一、设置多sheet.
REPORT ZMMR_CK_TEST2 . SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN. SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME. PARAMETERS:C1(10) TYPE C, C2(10) TYPE C, C3(10) TYPE C. SELECTION-SCREEN END OF BLOCK B1. SELECTION-SCREEN END OF SCREEN 100. SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN. SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME. PARAMETERS:Q1(10) TYPE C, Q2(10) TYPE C, Q3(10) TYPE C. SELECTION-SCREEN END OF BLOCK B2. SELECTION-SCREEN END OF SCREEN 200. SELECTION-SCREEN:BEGIN OF TABBED BLOCK mytab FOR 10 LINES, TAB (20) button1 USER-COMMAND push1, TAB (20) button2 USER-COMMAND push2, END OF BLOCK mytab. INITiALIZATION. BUTTON1 = '分页签1'. BUTTON2 = '分页签2'. mytab-prog = sy-repid. mytab-dynnr = 100. mytab-activetab = 'tab1'. "分页签切换 AT SELECTION-SCREEN. CASE SY-DYNNR. WHEN 1000. " PERFORM FORM1. CASE SY-UCOMM. WHEN 'PUSH1'. mytab-dynnr = 100. mytab-activetab = 'button1'. WHEN 'PUSH2'. mytab-dynnr = 200. mytab-activetab = 'button2'. WHEN OTHERS. ENDCASE. WHEN 100. WHEN 200. WHEN OTHERS. ENDCASE.
二、选项参数或block隐藏
勾选checkbox时,隐藏对应的标签或者block
REPORT ZMMR_CK_TEST2 . SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME. PARAMETERS:C1 AS CHECKBOX USER-COMMAND strt. PARAMETERS:C2 AS CHECKBOX USER-COMMAND strt. PARAMETERS:TEXT(20) MODIF ID AA. SELECTION-SCREEN END OF BLOCK B1. SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME . PARAMETERS:Q1(10) TYPE C MODIF ID TY1, Q2(10) TYPE C MODIF ID TY1, Q3(10) TYPE C MODIF ID TY1. SELECTION-SCREEN END OF BLOCK B2. AT SELECTION-SCREEN OUTPUT. LOOP AT SCREEN. IF C1 EQ 'X' AND SCREEN-GROUP1 = 'AA'. SCREEN-INVISIBLE = 1. SCREEN-ACTIVE = 0. MODIFY SCREEN. ENDIF. IF C2 EQ 'X' AND SCREEN-GROUP1 = 'TY1'. SCREEN-INVISIBLE = 1. SCREEN-ACTIVE = 0. MODIFY SCREEN. ENDIF. ENDLOOP.