on 06-29-2010 3:19 PM
Hi All,
I have built one dynamiv ALV and I have one name column inside that ALV for which I have to set read only property based on two column fields that exist in the same ALV,say IS_SP and IS_CORP of type boolean.
If any one of the flag is 'X',i have to make that name column as display only and
If both flag are not set,it should be displayed as ediatable column.
I have written one method as INIT_ALV which gets called when ALV is loaded.
Code is as follows:
lr_column_settings ?= wd_this->alv_all_roles.
lt_columns = lr_column_settings->get_columns( ).
LOOP AT lt_columns INTO ls_column.
CASE ls_column-id.
WHEN <NAMECOLUMN>. "name column which should be editable/display
Create Input Field
CREATE OBJECT lr_uie_input_field_ro
EXPORTING
value_fieldname = ls_column-id.
ls_column-r_column->set_cell_editor( lr_uie_input_field_ro ).
After this,I have to set the read only property based on IS_SP and IS_CORP values,
CALL METHOD lr_uie_input_field_ro->set_read_only_fieldname
EXPORTING
*value = 'IS_SP' or 'IS_CORP'
ENDLOOP.
I dont want to use cell variants also.
Help me to achieve this.
Thanks and Regards,
Divya
Divya - I have done it in the past following these documents. Please read it and try it it will work.
Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement)
thanks!
Jason PV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jason,
The issue is resolved.
I used set_read_only_fieldname method and passed IS_SP value and then
I used set_enabled_filedname method and passed IS_CORP value.
But while populating the ALV data,i negated the IS_CORP values as
loop
If <Str>-is_corp = abap_true.
<Str>-is_corp = abap_false.
else.
<Str>-is_corp = abap_true.
endif.
endloop.
so that the enabled property is set reversely and it wrks fine.
Anyways the links are helpful.
Regards,
Divya S
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.