ALV双击调用屏幕

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                        RS_SELFIELD TYPE SLIS_SELFIELD.
***开始***********  这段代码加上之后,才能对数据进行实时更新
  DATA: LR_GRID TYPE REF TO CL_GUI_ALV_GRID.
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      E_GRID = LR_GRID.
  CALL METHOD LR_GRID->CHECK_CHANGED_DATA.
  RS_SELFIELD-REFRESH = 'X'.
  RS_SELFIELD-COL_STABLE = 'X'.
  RS_SELFIELD-ROW_STABLE = 'X'.
***结束***********  这段代码加上之后,才能对数据进行实时更新
  CASE R_UCOMM.
    WHEN '&IC1'."双击事件
      DATA: IT_TEMP LIKE LINE OF IT_HEAD.
      SORT IT_HEAD BY MBLNR.
      READ TABLE IT_HEAD INTO IT_TEMP INDEX RS_SELFIELD-TABINDEX.
      IF SY-SUBRC = 0.
          SET PARAMETER ID 'MBN' FIELD IT_TEMP-MBLNR.
          CALL TRANSACTION 'MIGO' AND SKIP FIRST SCREEN.
          ENDIF.
    WHEN 'ALL'.
      LOOP AT IT_HEAD.
        IT_HEAD-SEL = 'X'.
        MODIFY IT_HEAD.
      ENDLOOP.
    WHEN 'SAL'.
      LOOP AT IT_HEAD.
        IT_HEAD-SEL = ''.
        MODIFY IT_HEAD.
      ENDLOOP.
    WHEN 'PRIT'.
      CLEAR IT_BODY.
      CLEAR IT_BODY[].
      CLEAR WA_HEAD.
      READ TABLE IT_HEAD WITH KEY SEL = 'X'."防止没有选择就打印
      IF SY-SUBRC = 0.
        PERFORM PRINT_DATA.
      ENDIF.

  ENDCASE.
ENDFORM.    

 
 

你可能感兴趣的:(ALV双击调用屏幕)