cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Rows editable in ALV

Former Member
0 Kudos

Hello,

I show some Records in my ALV and Column PersonalNumber is noneditable.

and I have created Append Row Button. If I click on this Button, then new added PersonalNumber should

be editable and old PersonalNumbers should be noneditable. How can we realize that?

otherwise; How can we make some editable and some noneditable in ALV?

Thanks!

with my Best Regards

Beserithan Malabakan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

See this [thread|;. I have given the sample code for this.

Regards,

Nithya

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Try this code for Editable ALV.

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_SETTINGS ?= L_VALUE.
  LR_COLUMN = LR_COLUMN_SETTINGS->GET_COLUMN( 'Your Field' ).

  CREATE OBJECT LR_INPUT_FIELD EXPORTING VALUE_FIELDNAME = 'Your Field'.
  LR_COLUMN->SET_CELL_EDITOR( LR_INPUT_FIELD ).

If any doubts let me know.

Thanks.

Edited by: Viji on Feb 28, 2008 12:14 PM

former_member182190
Active Participant
0 Kudos

Hi,

You need to be a little tricky to do this.

First of all make the ALV editable.

DATA:

lr_table_settings TYPE REF TO if_salv_wd_table_settings.

lr_table_settings ?= wd_this->r_table .

lr_table_settings->set_read_only( abap_false ).

Then add Text views as Input elements in your ALV for non editable columns

and Input fields for editable columns.

Hope this solves your problem.

Regards,

Ismail.