有时候需要控制选择画面的parameter来显示和不显示。
这时候我们有两种办法去做控制
1.把这个paramater的text和名字都设置为非显示
LOOP AT SCREEN INTO DATA(LW_SCREEN).
IF LW_SCREEN-NAME = '%_P_CLDB_O_%_APP_%-TEXT' OR LW_SCREEN-NAME = 'P_CLDB_O'.
LW_SCREEN-ACTIVE = 0.
LW_SCREEN-INVISIBLE = 1.
ENDIF.
MODIFY SCREEN FROM LW_SCREEN.
ENDLOOP.
修改之前为
修改之后为
2.第二种方式是给这些的选择画面的parameter设置modify id
选择屏幕定义代码
SELECTION-SCREEN BEGIN OF BLOCK CLBL04 WITH FRAME TITLE GV_SCR04.
PARAMETERS:
P_CLDB_O TYPE TABNAME "Table ID
MATCHCODE OBJECT DD_TABL
OBLIGATORY
MEMORY ID DTB.
PARAMETERS:
P_CLLANG TYPE T002-SPRAS DEFAULT SYST-LANGU.
SELECTION-SCREEN BEGIN OF LINE.
* SELECTION-SCREEN COMMENT 1(31) GV_TEX01.
PARAMETERS:
P_CLNROB TYPE NRIV-OBJECT NO-DISPLAY. "番号範囲オブジェクト名
* SELECTION-SCREEN COMMENT 44(23) GV_TEX02.
PARAMETERS:
P_CLNRNR TYPE NRIV-NRRANGENR NO-DISPLAY. "範囲間隔区別
SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN BEGIN OF BLOCK CLBL05 WITH FRAME TITLE GV_SCR05.
PARAMETERS:
P_CLPSDA TYPE ZAME_PRC_DATE "Start date
OBLIGATORY
DEFAULT SY-DATUM
MODIF ID GR5,
P_CLPSTI TYPE ZAME_PRC_TIME "Start time
OBLIGATORY
MODIF ID GR5,
CB_CLEXT AS CHECKBOX DEFAULT 'X' "extract up to current time
USER-COMMAND UC1
MODIF ID GR5,
P_CLPEDA TYPE ZAME_PRC_DATE "end date
MODIF ID GR1,
P_CLPETI TYPE ZAME_PRC_TIME "end time
MODIF ID GR1,
P_CLPRDA TYPE RVARI_VNAM "execution date id
MATCHCODE OBJECT ZAMCMS_TVARVC
MODIF ID GR5,
P_CLPRTI TYPE RVARI_VNAM "execution time id
MATCHCODE OBJECT ZAMCMS_TVARVC
MODIF ID GR5.
*SELECTION-SCREEN END OF BLOCK CLBL05.
SELECTION-SCREEN END OF BLOCK CLBL04.
代码如下
LOOP AT SCREEN INTO DATA(LW_SCREEN).
IF LW_SCREEN-GROUP1 = 'GR5'.
LW_SCREEN-ACTIVE = 0.
CLEAR:
P_CLPEDA,
P_CLPETI.
ENDIF.
MODIFY SCREEN FROM LW_SCREEN.
ENDLOOP.
修改之前为
修改之后