on 11-25-2009 9:28 AM
hi,
I am using alv in webdynpro. There is one column with inputfield as cell editor. Based on some conditions i have to make that column read only for some records and editable for others.
How can i bind the readonly property of context attribute with alv column?
thanks,
Varuna
Hi,
To make an input field read only:
CREATE OBJECT lo_inputfield
EXPORTING
value_fieldname = 'APPR_STATUS'.
lo_column = lo_column_setting->get_column( 'APPR_STATUS' ).
lo_column->set_cell_editor( lo_inputfield ).
LO_INPUTFIELD->SET_READ_ONLY( ABAP_TRUE)
based on your conditions you can make it ABAP_TRUE or ABAP_FALSE.
Priya
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
check this Wiki https://wiki.sdn.sap.com/wiki/display/WDABAP/How%20to%20edit%20conditionally%20row%20of%20a%20ALV%20...
Conditionally Assigning Colors and Input Enable to ALV Columns in Web Dynpro for ABAP
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
The steps would be :
1.Add attributes READONLY of type ABAP_BOOL to the node binded to table.
2. Based on logic assign Readonly values.
loop at itab into wa.
if wa-C1 > 0.
wa-readonly = abap_true.
else.
wa-readonly = abap_false.
endif.
modify itab from wa.
endloop.
3. Now add this read only attribute to the column which you wanted.
l_column = l_value->if_salv_wd_column_settings~get_column( 'C2' ).
CREATE OBJECT lo_input
EXPORTING
value_fieldname = 'C2'.
l_column->set_cell_editor( lo_input ).
lo_input ->set_read_only( value = 'READONLY')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.