ABAP OOALV中實現可編輯,並校驗輸入內容

2021-10-10 15:39:28 字數 2091 閱讀 6211

**如下:

class gcl_event_receiver definition.

public section.

methods handle_data_changed

for event data_changed of cl_gui_alv_grid

importing er_data_changed.

endclass.

先修改,再重新整理alv

**如下:

class gcl_event_receiver implementation.

method handle_data_changed.

clear **_stop.

perform frm_data_changed using er_data_changed.

perform frm_refresh_alv using gcl_alvgrid.

endmethod.

endclass.

form frm_data_changed  using uo_data_changed type ref to cl_alv_changed_data_protocol.

loop at uo_data_changed->mt_mod_cells assigning field-symbol().

case -fieldname.

when 'zqxfz'."判斷修改的是哪個字段

check -value is not initial.

translate -value to upper case.

condense -value no-gaps.

read table gt_tab assigning field-symbol() index -row_id.

if sy-subrc = 0.

loop at gt_tab transporting no fields where zqxfz = -value.

"下面的方法用來填寫message

call method uo_data_changed->add_protocol_entry

exporting

i_msgid = 'oo'

i_msgty = 'e'

i_msgno = '000'

i_ms**1 = '許可權重複'

i_fieldname = -fieldname

i_row_id = -row_id

i_tabix = -tabix.

-zqxfz = -value.

**_stop = abap_true.

return.

endloop.

select zqxms into -zqxms from zyktssf0200 where zqxfz = -value.endselect.

endif.

when others.

endcase.

endloop.

endform.

form frm_refresh_alv  using icl_alvgrid type ref to cl_gui_alv_grid.

data: ls_stbl type lvc_s_stbl,

lr_grid type ref to cl_gui_alv_grid..

"穩定重新整理

ls_stbl-row = abap_true. "基於行的穩定重新整理

ls_stbl-col = abap_true. "基於列穩定重新整理

call function 'get_globals_from_slvc_fullscr' "得到當前螢幕上的alv的控制代碼

importing

e_grid = lr_grid.

call method lr_grid->refresh_table_display

exporting

is_stable = ls_stbl.

endform.

QT實現可編輯組合框

1.應用場景描述 在使用qcombobox對列表中的內容進行選擇的同時能夠修改item項 一般來說不應該出現這樣的需求,既然使用qcombobox,那麼就應該是對已設定好內容進行選擇,實際應用中最好再重新設計功能模組 2.實現 1 首先在qtcreator中很容易能夠發現qcombobox有乙個屬性...

可編輯樹extjs

ext.ns htsoft.ux company 巨集天軟體 createtime 2010 01 02 author csx class treepaneleditor extends ext.tree.treepanel description 樹選單編輯器,可帶右鍵操作選單,使用方式示例見ar...

PHP實現可編輯查詢下拉框

實現方式 easyui 的combobox控制項 實現效果如下 實現過程如下 下拉框 select 其中需要引入的標頭檔案是 另 combobox 的值需要通過以下方式獲取 sa jxid combobox getvalue var jxid sa.val 注 1 下拉框的資料以 volist 的方...