cancel
Showing results for 
Search instead for 
Did you mean: 

ALV table - Convert Cell editors from default textView to textEdit

Former Member
0 Kudos

Hi,

I have created a ALV table by adding a View Container Element and addding SALV_WD_TABLE. Somehow the table is input disabled. I want to make it input enabled. In one of the posts I was advised to make the cell editor from default textView to textEdit. But i am not sure how to do this. In the Layout tab i am not seeing any column names in the desing time as i have added a "View Container Element". Do i need to do this programatically? If yes, can you please suggest how to do this?

Thanks,

Aditya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

see the [Documentation|http://help.sap.com/saphelp_nw2004s/helpdata/en/7e/ce322aa1684aafaad4acdeadb5660b/frameset.htm] on write protection

Grtz,

Koen

Former Member
0 Kudos

Hi,

Thanks for the link. I have gone through this. It is taking about how to switch off the write protection. I did that but still the cell fields are disabled. Can you please let me know?

  • create an instance of ALV component

DATA:

lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.

lr_salv_wd_table_usage = wd_this->wd_cpuse_alv_comp( ).

IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.

lr_salv_wd_table_usage->create_component( ).

ENDIF.

  • get ALV component

DATA:

lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.

lr_salv_wd_table = wd_this->wd_cpifc_alv_comp( ).

wd_this->alv_config_table = lr_salv_wd_table->get_model( ).

DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.

lr_table_settings ?= wd_this->alv_config_table.

lr_table_settings->set_read_only( abap_false ).

lr_table_settings->SET_ENABLED( abap_true ).

Former Member
0 Kudos

Please try the below code;

DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,

lr_col_header TYPE REF TO cl_salv_wd_column_header.

DATA: lt_columns TYPE salv_wd_t_column_ref.

DATA: ls_column TYPE salv_wd_s_column_ref.

DATA: ls_tooltip TYPE string.

DATA: lr_inputfield TYPE REF TO cl_salv_wd_uie_input_field.

lr_column_settings ?= wd_this->alv_config_table.

lt_columns = lr_column_settings->get_columns( ).

  • loop over table - in each loop each column can be modified

LOOP AT lt_columns INTO ls_column.

  • " get header of column

IF ls_column-id = 'XXXX' OR ls_column-id = 'YYYY'. ".... Exclude the columns that you dont want to handle

ELSE.

CREATE OBJECT lr_inputfield

EXPORTING

value_fieldname = ls_column-id.

lr_col_header = ls_column-r_column->get_header( ).

ls_column-r_column->set_cell_editor( lr_inputfield ).

" do any other settings here.

ENDIF.

ENDLOOP.

Let me know if it helps.

Regards,

Kumar.

Former Member
0 Kudos

Kumar,

Cool!!. It worked!!. Thanks a bunch.

Aditya.

Answers (1)

Answers (1)

Former Member
0 Kudos

You need to do it Programmatically.

see salv_wd_test_extended component , method on_data_set( ).