cancel
Showing results for 
Search instead for 
Did you mean: 

Set a specific column editable in WebDynpro

diegofrozza
Participant
0 Kudos
1,218

Dear All,

I'm using the ALV Webdynpro with SALV_WD_TABLE Component and I need to set in a specific case one column for a indexed line editable.

I did this using the normal table compoment, but when I use this SALV_WD_TABLE i just can set a specific column for all table entries.

There is a way to do this for one table entrie?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi.

You have to add a new attribute in the context node (output structure) of the type char01, to control the cell behaviour. Usually this new field is created with the name READ_ONLY.

In the method that you handle the ALV objects you can do something like this:

I don't put the other declaration as I supposed that you already have all set.


DATA: lo_input_field  type ref to cl_salv_wd_uie_input_field.  "This class that you should use to achieve what you want.

    lo_column_settings ?= lo_alv_model.

    lt_columns = lo_column_settings->get_columns( ).

    LOOP AT lt_columns INTO ls_column where ID = CELL_EXAMPLE'.

         CREATE OBJECT lo_input_field EXPORTING value_fieldname = ls_column-id.

         lo_input_field->set_read_only_fieldname( 'READ_ONLY' ).

         ls_column-r_column->set_cell_editor( lo_input_field ).

    ENDLOOP.

Then, wherever in your code you are filling the internal table that you are binding to the context, you have to set the value to the new field READ_ONLY as per your requirement:

Example:

loop at lt_output into ls_output.

  if ls_output-date = sy-datum.

    ls_output-read_only = abap_true.

  else.

    ls_output-read_only = abap_false.

  endif.

  modify lt_output from ls_output.

endloop.

Hope it helps.
Felipe

diegofrozza
Participant
0 Kudos

Thanks, Felipe.

The way you explain make me understand better what I should do.

Answers (1)

Answers (1)

former_member197475
Active Contributor
0 Kudos