zoukankan      html  css  js  c++  java
  • ALV 自定义全选按钮,选择框自动打勾

    REUSE_ALV_GRID_DISPLAY 的 i_callback_user_command 参数定义

    form user_command using ucomm  like sy-ucomm   selfield type slis_selfield.
      selfield-refresh = 'X'.
      selfield-col_stable = 'X'.
      selfield-row_stable = 'X'.
    
      data: lo_guid type ref to cl_gui_alv_grid.
    
      case ucomm.
        when 'ZEXEC'.
    *  取得当前alv的grid
          call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            importing
              e_grid = lo_guid.
          call method lo_guid->check_changed_data.
    
          selfield-refresh = 'X'.
          perform frm_update.   "可以写更新代码
    
        when 'SELECT'."全选
    *  取得当前alv的grid
          call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            importing
              e_grid = lo_guid.
          call method lo_guid->check_changed_data.
          selfield-refresh = 'X'.
          loop at r3_data.    "BOX 用作复选框列
            r3_data-box = 'X'.
            modify r3_data.
          endloop.
    
        when 'UNSELECT'."全不选
    *  取得当前alv的grid
          call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            importing
              e_grid = lo_guid.
          call method lo_guid->check_changed_data.
          loop at r3_data.
            r3_data-box = ''.
            modify r3_data.
          endloop.
          selfield-refresh = 'X'.
        when others.
      endcase.
    
    endform.                    "user_command

    abap菜鸟,记录学习笔记。才疏学浅,如有错误,请直接在评论区留言。
  • 相关阅读:
    第二次作业
    初学JAVA的 感想 尹鑫磊
    初学JAVA 感想
    《将博客搬至CSDN》
    JAVA中的几种内部类
    JAVA-静态变量与实体变量
    teacher页面的代码
    测试说明书的概述和摘要
    网站的概述
    html与xhtml的区别
  • 原文地址:https://www.cnblogs.com/freeandeasy/p/14786086.html
Copyright © 2011-2022 走看看