Skip to Content
Former Member
May 24, 2010 at 01:40 PM

Unable to make a dynamic ALV editable.


Hi ,

I have created an ALV having a dynamic context structure.

My problem is that im not able to change the properties of the ALV to editable using the following code.

*-- Get an instance of the ALV configuration Model -


lo_interfacecontroller = wd_this->wd_cpifc_alv_dynamic( ).

data lv_value type ref to cl_salv_wd_config_table.

lv_value = lo_interfacecontroller->get_model(


*-- Making the ALV columns editable -


data : lo_column type ref to cl_salv_wd_column,

lif_column_settings type ref to if_salv_wd_column_settings,

lo_input_field type ref to cl_salv_wd_uie_input_field.

data : lt_columns type salv_wd_t_column_ref.

field-symbols : <ls_columns> like line of lt_columns.

lif_column_settings ?= lv_value.

lt_columns = lif_column_settings->get_columns( ).

loop at lt_columns assigning <ls_columns>.

create object lo_input_field


value_fieldname = <ls_columns>-id.

<ls_columns>-r_column->set_cell_editor( lo_input_field ).


*-- Making the ALV editable -


data : lif_table_settings type ref to if_salv_wd_table_settings.

lif_table_settings ?= lv_value.

lif_table_settings->set_read_only( abap_false ).

I have created the dynamic context by creating a node and adding attributes to it at runtime.

The weird part is that , if i create a dynamic context by adding the attributes to a structure description(cl_abap_structdescr) object and pass it to the 'statis_element_rtti' parameter , the code works fine and the ALV is editable.

But my requirement does not allow me to use a structure description object.

I have to add the attributes at runtime after adding the node.

Please suggest a solution.