登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

原来为了你

我的人生就是要一次次的超越

 
 
 

日志

 
 
 
 

设置alv可编辑  

2011-01-07 15:56:26|  分类: ALV |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

1输出内表gt_output中定义字段:
datal_style   type lvc_t_styl.       "设置可否编辑

2定义gs_layout:
datags_layout type lvc_s_layo.
gs_layout
-stylefname 'L_STYLE'.

3设置某字段

datals_style type lvc_s_styl,
      lt_style 
type lvc_t_styl.

if g_edit ''.
  
loop at gt_eban.
    
clear lt_style[].
    
clear ls_style.
    ls_style
-fieldname 'FIELDXX'"设置字段
    ls_style
-style cl_gui_alv_grid=>mc_style_enabled."可编辑
    
append ls_style to lt_style.

    gt_eban
-l_style[] lt_style[].

    
modify gt_eban.
  
endloop.
  g_edit 
'X'.

elseif g_edit 'X'.
  
loop at gt_eban.
    
clear lt_style[].
    
clear ls_style.
    ls_style
-fieldname 'FIELDXX'.
    ls_style
-style cl_gui_alv_grid=>mc_style_disabled."不可编辑
    
append ls_style to lt_style.

    gt_eban
-l_style[] lt_style[].
    
modify gt_eban.
  
endloop.
  g_edit 
''.
endif.  
4输出内表:
call function 'REUSE_ALV_GRID_DISPLAY_LVC'
    
exporting
      i_callback_program       
sy-repid
      i_callback_pf_status_set 
'FRM_PF_STATUS_SET'
      i_callback_user_command  
'FRM_ALV_COMMAND'
      is_layout_lvc            
gs_layout
      it_fieldcat_lvc          
gt_fieldcat[]  "'[]' is necessary
      i_save                   
'A'
      it_sort_lvc              
gt_sort[]
    
tables
      t_outtab                 
gt_output
    
exceptions
      program_error            
1
      
others                   2.

5更新数据:
form frm_alv_command using ucomm type sy-ucomm
                     rs_selfield 
type slis_selfield.

  
datalr_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-row_stable = 'X'.
* rs_selfield-col_stable = 'X'.
* read table itab index rs_selfield-tabindex.
endform.

  评论这张
 
阅读(745)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018