ABAP CHECKBOX 选中事件


当用户选中勾选框后, 原本可以输入的field 变为不可输入。 





REPORT ZTEST_N.
DATA screen_wa TYPE SCREEN.


SELECTION-SCREEN BEGIN OF SCREEN 100.


SELECTION-SCREEN BEGIN OF BLOCK part1 WITH FRAME TITLE TEXT-001.
PARAMETERS field(10) TYPE c ."OBLIGATORY.
SELECTION-SCREEN END OF BLOCK part1.






SELECTION-SCREEN BEGIN OF BLOCK part2 WITH FRAME TITLE TEXT-002.
PARAMETERS: a AS CHECKBOX USER-COMMAND flag.
SELECTION-SCREEN END OF BLOCK part2.






SELECTION-SCREEN END OF SCREEN 100.


AT SELECTION-SCREEN OUTPUT.


  LOOP AT screen INTO screen_wa.
    IF a = 'X'  AND screen_wa-NAME = 'FIELD'.
       screen_wa-active = '0'.
       MODIFY screen FROM screen_wa.
    ENDIF.
  ENDLOOP.



CLASS start DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS main.
ENDCLASS.


CLASS start IMPLEMENTATION.
  METHOD main.
    CALL SELECTION-SCREEN 100 STARTING AT 10 10.
    IF sy-subrc <> 0.
      RETURN.
    ENDIF.
  ENDMETHOD.
ENDCLASS.


START-OF-SELECTION.
  start=>main( ).

你可能感兴趣的:(ABAP)