2016 Aug 02 3:43 PM
hi,
i need to disable some of the checkboxes based on some condition in alv using FM approach.i have tried s_layout-box_fieldname = '-'.but, check box is going off completely.i want to grey it out.i dont want to completely remove the check box
hi,
i need to disable some of the checkboxes based on some condition in alv using FM approach.i have tried s_layout-box_fieldname = '-'.but, check box is going off completely.i want to grey it out.i dont want to completely remove the check box
2016 Aug 02 5:05 PM
Hi,
1) add field celltab TYPE lvc_t_styl in your internal table.
2) add below code after define ALV container:
CALL METHOD ref_alv->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter
3)fill layout field like this: p_layout-stylefname = 'CELLTAB’.
4)add below code before call first_display:
CALL METHOD ref_alv ->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
5) add below code after call first_display:
* Set editable cells to ready for input initially
CALL METHOD alv->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
6) when you want disabled checkbox field, fill celltab field like this:
ls_celltab-fieldname = <field_name>.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT ls_celltab INTO TABLE lt_celltab.
Let me know,
AI
2016 Aug 02 6:14 PM
Just to supplement the given answer: there are some demo reports created by SAP that present the features of ALV. Editing only selected cells within ALV is presented in report BCALV_EDIT_02.
Approach used there is OO but I believe the general idea should be the same.
2016 Aug 04 3:42 PM
i found that there is no way ,to disable some checkboxes using reuse_alv_grid_display.we have to use either reuse_alv_grid_display_lvc or oop alv..using custom container..
2016 Aug 08 9:22 AM
You use ALV OO because my code is just for this typologi of ALV.
AI