首页 > SAP > ABAP > 选择屏幕的一些常用功能例子(1)–设置元素的可用性
2019
08-29

选择屏幕的一些常用功能例子(1)–设置元素的可用性

选择屏幕上按选择内容设置元素的可用性

[pre]

SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-BL1.

PARAMETERS: PAR1 RADIOBUTTON GROUP RA1 USER-COMMAND SCR DEFAULT ‘X’.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS:      S_WERKS1 FOR MARC-WERKS MODIF ID ABC .

*SELECTION-SCREEN COMMENT 52(50) NAME1 MODIF ID ABC.

SELECT-OPTIONS:      S_MATNR1 FOR MARC-MATNR MODIF ID ABC.

*SELECTION-SCREEN COMMENT 52(50) MAKTX1 MODIF ID ABC.

SELECTION-SCREEN END OF BLOCK B1.

PARAMETERS: PAR2 RADIOBUTTON GROUP RA1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

SELECT-OPTIONS:      S_ASORT2 FOR WRS1-ASORT MODIF ID DEF .

*SELECTION-SCREEN COMMENT 52(50) NAME2 MODIF ID DEF.

SELECT-OPTIONS:      S_MATNR2 FOR MARC-MATNR MODIF ID DEF.

*SELECTION-SCREEN COMMENT 52(50) MAKTX2 MODIF ID DEF.

SELECTION-SCREEN END OF BLOCK B2.

PARAMETERS: PAR3 RADIOBUTTON GROUP RA1.

SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.

SELECT-OPTIONS:      S_MATNR3 FOR MARC-MATNR MODIF ID HIJ.

*SELECTION-SCREEN COMMENT 52(50) MAKTX3 MODIF ID HIJ.

SELECTION-SCREEN END OF BLOCK B3.

PARAMETERS:       P_CHARG AS CHECKBOX .

*SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-004.

*PARAMETERS:      P_MATNR4 TYPE MCHA-MATNR MODIF ID KLM.

*SELECTION-SCREEN COMMENT 52(50) MAKTX4 MODIF ID KLM.

*SELECT-OPTIONS:  S_CHARG  FOR MCHA-CHARG MODIF ID KLM NO-EXTENSION  .

*SELECTION-SCREEN END OF BLOCK B4.

SELECTION-SCREEN END OF BLOCK BL1.

AT SELECTION-SCREEN OUTPUT.

*  COMM1 = ‘1’.

  LOOP AT SCREEN.

    IF PAR1 = ‘X’.

      IF  SCREEN-GROUP1 = ‘ABC’.

        SCREEN-ACTIVE = ‘1’.

        MODIFY SCREEN.

      ELSEIF SCREEN-GROUP1 = ‘DEF’ .

        SCREEN-ACTIVE = ‘0’.

        MODIFY SCREEN.

      ELSEIF SCREEN-GROUP1 = ‘HIJ’.

        SCREEN-ACTIVE = ‘0’.

        MODIFY SCREEN.

      ELSEIF SCREEN-GROUP1 = ‘KLM’.

        SCREEN-ACTIVE = ‘0’.

        MODIFY SCREEN.

      ENDIF.

    ELSEIF PAR2 = ‘X’.

      IF SCREEN-GROUP1 = ‘ABC’.

        SCREEN-ACTIVE = ‘0’.

        MODIFY SCREEN.

      ELSEIF SCREEN-GROUP1 = ‘DEF’ .

        SCREEN-ACTIVE = ‘1’.

        MODIFY SCREEN.

      ELSEIF SCREEN-GROUP1 = ‘HIJ’.

        SCREEN-ACTIVE = ‘0’.

        MODIFY SCREEN.

      ELSEIF SCREEN-GROUP1 = ‘KLM’.

        SCREEN-ACTIVE = ‘0’.

        MODIFY SCREEN.

      ENDIF.

    ELSEIF PAR3 = ‘X’ .

      IF SCREEN-GROUP1 = ‘ABC’.

        SCREEN-ACTIVE = ‘0’.

        MODIFY SCREEN.

      ELSEIF SCREEN-GROUP1 = ‘DEF’ .

        SCREEN-ACTIVE = ‘0’.

        MODIFY SCREEN.

      ELSEIF SCREEN-GROUP1 = ‘HIJ’.

        SCREEN-ACTIVE = ‘1’.

        MODIFY SCREEN.

      ELSEIF SCREEN-GROUP1 = ‘KLM’.

        SCREEN-ACTIVE = ‘0’.

        MODIFY SCREEN.

      ENDIF.

    ENDIF.

  ENDLOOP.

[/pre]

最后编辑:
作者:yangsen
本站为个人博客网站,全由我个人维护,我从事SAP开发13年,其它ERP开发7年,基本都是零售行业。本站记录工作学习的过程, 有SAP相关询问专、兼职工作可随时联系我。 有网站相关的问题可直接在文章下方留言,或者联系我。 邮件:yan252@163.com给我。 QQ:415402519

留下一个回复

你的email不会被公开。

12 − five =