• ALV 可编辑修改内表值 可修改列定义F4搜索帮助


    data i_grid_settings type lvc_s_glay.
    i_grid_settings-edt_cll_cb = 'X'. "更改数据后更新表数据
    
    call function 'REUSE_ALV_GRID_DISPLAY'
    * EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
    *   I_CALLBACK_PROGRAM                = ' '
    *   I_CALLBACK_PF_STATUS_SET          = ' '
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
    *   I_GRID_TITLE                      =
       i_grid_settings                   = i_grid_settings
    *   IS_LAYOUT                         =
    *   IT_FIELDCAT                       =
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
    *   IS_VARIANT                        =
    *   IT_EVENTS                         =
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
      tables
        t_outtab                          =
    * EXCEPTIONS
    *   PROGRAM_ERROR                     = 1
    *   OTHERS                            = 2
              .
    if sy-subrc <> 0.
    * Implement suitable error handling here
    endif.
    
    form user_command using ucomm  like sy-ucomm   selfield type slis_selfield.
    
      selfield-refresh = 'X'. "刷新
      selfield-col_stable = 'X'.
      selfield-row_stable = 'X'.
      if ucomm = 'ZEXCE'.      
        perform frm_update.   "可以写更新代码
      endif.
    endform.                    "user_command

    因为自己在写新数据时,但是根据上面定义好了,在这个列中要加入F4搜索帮助,但是在写入值后内表该字段的值在后台始终是空的,需要定义表字段slis_fieldcat_alv中定义

    ref_tabname和ref_fieldname两字段值,但其取值应该取其检查表

      gs_fieldcat-ref_tabname = 'T001L'.  "而不是mard
      gs_fieldcat-ref_fieldname = 'LGORT'.
    abap菜鸟,记录学习笔记。才疏学浅,如有错误,请直接在评论区留言。
  • 相关阅读:
    四个例子实战讲解.htaccess文件rewrite规则(转)
    unserialize反序列化错误的解决办法
    tp框架--------where("1")
    jq 鼠标点击跳转页面后 改变点击菜单的样式代码
    jq不懂的地方
    js产生随机数的几个方法
    js邮箱,汉字,数字 表单验证
    js&jQ判断checkbox表单是否被选中
    绝对好用Flash多文件大文件上传控件
    CKeditor从Word粘贴格式问题
  • 原文地址:https://www.cnblogs.com/freeandeasy/p/14651966.html
Copyright © 2020-2023  润新知