cancel
Showing results for 
Search instead for 
Did you mean: 

Need to make some cells of checkbox column is editable, some non editable on alv table

Former Member
0 Kudos

Hi, experts. I'm beginner in Web Dynpro.

I have ALV-table. The problem is I want that some cell of checkbox column will be editable, some cell will be non editable depending on some property.

I make next steps to achieve the required result:

1) Add attribute READONLY ( type WDY-BOOLEAN ) to the corresponding node ( attribute CHECK type WDY-BOOLEAN has already added ) .

2) Then in my code I Check some conditions in row of my table and assign attribute READONLY value abap_true or abap_false.

3) Then I bind my node with  table ( table is filled absolutely right ( I controle it in debugger ) )

4) Configure my alv:

" create an instance of ALV component

  " get reference to the ALV model

  DATA:

    lo_table_settings TYPE REF TO if_salv_wd_table_settings,

    lo_column_settings TYPE REF TO if_salv_wd_column_settings,

    lo_column TYPE REF TO cl_salv_wd_column.

  lo_column_settings ?= lv_value.

  lo_table_settings ?= lv_value.

  lo_column = lv_value->if_salv_wd_column_settings~get_column( 'CHECK' ).

   DATA lr_checkbox TYPE REF TO cl_salv_wd_uie_checkbox.

" create checkbox

   CREATE OBJECT lr_checkbox

    EXPORTING

      checked_fieldname = 'CHECK'.

  " make our table is editable

    lo_table_settings->set_read_only( abap_false ).

lo_column = lo_column_settings->get_column( 'CHECK' ).

**Creating UI Elmenent 'INPUT FIELD' to make the column editable

DATA: lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.

CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'CHECK'.

  lr_checkbox->set_read_only_fieldname( value = 'READONLY' ).

  lv_value->if_salv_wd_column_settings~delete_column( ID = 'READONLY'  ).

But it doesn't work. All of cells of checbox's column is editable and I don't get non editable cells of checbox's column ( although according to my field 'READONLY' I have to see some cells editable, some --- non editable  ).

Make this building this tutorials:

http://www.saptechnical.com/Tutorials/WebDynproABAP/Color/Edit.htm

http://scn.sap.com/thread/452097

http://scn.sap.com/thread/1336088

http://scn.sap.com/thread/1400116

and many others.

Please help to solve this problem!

Accepted Solutions (1)

Accepted Solutions (1)

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Aren't you are missing a:

lo_column->set_cell_editor( lr_checkbox ).

or something?

Best regards,

Guillaume

Answers (0)