on 2015 Sep 03 5:45 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please see the below wiki.
How to edit conditionally row of a ALV table in Web Dynpro for ABAP - Web Dynpro ABAP - SCN Wiki
BR,
RAM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.