Hi Rohit,
By default, textview will be the editor in your dynamic table, here you need to create input field and set as cell editor.
Try the below code to make all columns as editable.
METHOD wddomodifyview .
DATA : l_root TYPE REF TO cl_wd_uielement_container,
l_node TYPE REF TO if_wd_context_node,
l_table TYPE REF TO cl_wd_table.
DATA lt_cols TYPE TABLE OF REF TO cl_wd_table_column.
DATA ls_cols LIKE LINE OF lt_cols.
DATA lo_textview TYPE REF TO cl_wd_text_view.
DATA lo_input TYPE REF TO cl_wd_input_field.
DATA lv_path TYPE string.
DATA lv_id TYPE string.
IF first_time = abap_true.
l_root ?= view->get_root_element( ).
l_node = wd_context->get_child_node( 'MY_NODE' ).
l_table =
cl_wd_dynamic_tool=>create_table_from_node(
ui_parent = l_root
table_id = 'MY_TABLE' " Table ID
node = l_node
).
lt_cols = l_table->get_columns( ).
LOOP AT lt_cols INTO ls_cols.
" Default editor in dyn table is textview, get editor
lo_textview ?= ls_cols->get_table_cell_editor( ).
" get binding path and id
lv_path = lo_textview->bound_text( ).
lv_id = lo_textview->get_id( ).
" create new input element
free lo_input.
cl_wd_input_field=>new_input_field(
EXPORTING
bind_value = lv_path " BIND_VALUE
id = lv_id
RECEIVING
control = lo_input " CONTROL
).
"set new editor to cell
if lo_input is BOUND.
ls_cols->set_table_cell_editor(
the_table_cell_editor = lo_input ).
endif.
ENDLOOP.
ENDIF.
Hope this helps you.
Regards,
Rama
ENDMETHOD.