on 06-26-2009 3:45 PM
Hi,
I want enable/disable checkbox in same column based on a condition in internal table
I have created checkbox by defining char1 under context node
I am using following code for checkbox creation.
lr_column = l_value->if_salv_wd_column_settings~get_column( 'PCRTD' ).
CREATE OBJECT lr_checkbox
EXPORTING
checked_fieldname = 'PCRTD'.
lr_checkbox->set_enabled( 'X' ).
lr_column->set_cell_editor( lr_checkbox ).
how do we achive this?
Rgds
Vara
Hi,
If i understand your query correctly, you want to create a checkbox in an ALV column and based on some condition you wnat to enable/disable it.
Please follow these steps:
1. Create an attribute 'EDITABLE' type boolean under the same node that is bound to your ALV.
2. Create the checkbox and bind the readonly property using the following code.
DATA: lt_columns TYPE salv_wd_t_column_ref ,
ls_columns TYPE salv_wd_s_column_ref .
DATA: l_column_header TYPE REF TO cl_salv_wd_column_header .
lt_columns = l_column_settings->get_columns( ) .
LOOP AT lt_columns INTO ls_columns .
CASE ls_columns-id .
WHEN 'PCRTD' .
" create checkbox
DATA: lr_chkbox TYPE REF TO cl_salv_wd_uie_checkbox.
CREATE OBJECT lr_chkbox
EXPORTING
checked_fieldname = ls_columns-id
ls_columns-r_column->set_cell_editor( lr_chkbox ) .
"binding the read only property
lr_chkbox->set_read_only_fieldname( 'EDITABLE' ).
ENDLOOP.
3. No just pass abap_false/abap_true to the field EDITABLE to make the checkbox editable/disabled .
and bind the table to the node.
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
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.