Skip to Content
avatar image
Former Member

Reg ALV - Urgent

The following is my requirement.

I have to make the entire row of my ALV Table Ineditable

based on the content of a field in that row.

e.g.

Say, In my ALV table, i have a column field 'STATUS'

If in a row, the status cell has value 'Released' then that entire row should be ineditable else editable.

Need your Inputs ASAP.

Thank U..

Sravan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    May 15, 2006 at 04:45 AM

    Hi Sravan,

    For this, you have to make the column editable and then use the property called set_visible_fieldname.

    I assume currently you have made your ALV editable.

    Next to make an ALV selectively editable or non-editable, add a string attribute say 'EDITYESNO'. Based on the value of your release status set the the value of 'EDITYESNO' to '02'(Editable) or '00' (Non-editable).Say the column name you want to make editable or non-editable is 'NAME', then use the following code.

    • set cell editor for input fields

    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,

    lr_input_field TYPE REF TO cl_salv_wd_uie_input_field,

    lr_column type ref to CL_SALV_WD_COLUMN.

    lr_column_settings ?= l_value.

    lr_column = lr_column_settings->get_column( 'NAME' ).

    CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'NAME'.

    lr_input_field->set_visible_fieldname( 'EDITYESNO' ).

    lr_column->set_cell_editor( lr_input_field ).

    Regards,

    Srini.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      this code make column 'NAME' editable or noneditable...i want to make this change for a particular row..like for row index x i want my column 'NAME' editable..