cancel
Showing results for 
Search instead for 
Did you mean: 

ALV table is read only but it looks like it's editable.....

Former Member
0 Kudos

Hi Experts,

there is an alv table. The entries are not editable, they're read_only.

But the table looks like it is editable. The cells color is white. But the table should look like a not-editable table, for example like not filled rows in alv table.

I tried with this kind of coding:

lr_column = lr_column_settings->get_column( 'TIME' ).
  CREATE OBJECT lr_input_field
    EXPORTING
      value_fieldname = 'TIME'.
  lr_input_field->set_read_only_fieldname( value = 'READ_ONLY' ).

Unfortunately its not working.

Is this the correct way or should I try to change the cells color?

Thanks in advance,

Tan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Tan,

You want to make complete table readonly or some cells as read only??

lr_column = lr_config->if_salv_wd_column_settings~get_column('OBJID' ).

CREATE OBJECT lr_link.

lr_link->set_text_fieldname( 'OBJID' ).

lr_column->set_cell_editor( lr_link ).

lr_column->set_read_only('x'). // try with X or ABAP_TRUE.

check this..

https://wiki.sdn.sap.com/wiki/display/WDABAP/How%20to%20edit%20conditionally%20row%20of%20a%20ALV%20...

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d...

Cheers,

Kris.

Former Member
0 Kudos

Hi,

it's the whole table I want to set read only.

What is the type of lr_link and lr_config.

Thanks.....currently checking the second link you posted.

Madhu2004
Active Contributor
0 Kudos

hi,

Whole table is set read only by default. Even you can use the below code :

You will get the object of CL_SALV_WD_CONFIG_TABLE when you insytanatiate alv and call the get_model method

data lo_config type ref to cl_salv_wd_config_table.

lo_config->if_salv_wd_table_settings~set_read_only( ABAP_TRUE ).

Regards,

Madhu

Former Member
0 Kudos

Hi,

it's working now. Thank you guys. I used kissnas' second link.

Tan

Answers (1)

Answers (1)

Former Member
0 Kudos

your table should have a property such as "Design" where you can change the color of the cells. You can set it or even bind it to a variable.