on 05-20-2013 10:54 AM
Hi, can anyone tell me d steps on How to add a checkbox in ALV?? Thanks Vijay
Hi Vijay,
Please refer below mentioned code for the same:
For check box create the node attribute as boolean i.e.,WDY_BOOLEAN for check box
DATA:
lr_alv_usage TYPE REF TO if_wd_component_usage,
lr_if_controller TYPE REF TO iwci_salv_wd_table,
lr_config TYPE REF TO cl_salv_wd_config_table,
lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lt_columns TYPE salv_wd_t_column_ref,
lr_link TYPE REF TO cl_salv_wd_uie_link_to_action,
lr_checkbox TYPE REF TO cl_salv_wd_uie_checkbox,
lr_image type ref to cl_salv_wd_uie_image.
FIELD-SYMBOLS
<fs_column> LIKE LINE OF lt_columns.
* Instantiate the ALV Component
lr_alv_usage = wd_this->wd_cpuse_cmp_alv( ).
IF lr_alv_usage->has_active_component( ) IS INITIAL.
lr_alv_usage->create_component( ).
ENDIF.
* Get reference to model
lr_if_controller = wd_this->wd_cpifc_cmp_alv( ).
lr_config = lr_if_controller->get_model( ).
* Set the UI elements.
lr_column_settings ?= lr_config.
lt_columns = lr_column_settings->get_columns( ).
LOOP AT lt_columns ASSIGNING <fs_column>.
CASE <fs_column>-id.
WHEN 'CARRID'.
CREATE OBJECT lr_link.
lr_link->set_text_fieldname( <fs_column>-id ).
<fs_column>-r_column->set_cell_editor( lr_link ).
WHEN 'CONNID'. "For which checkbox needs to be created
CREATE OBJECT lr_checkbox
EXPORTING
checked_fieldname = <fs_column>-id.
<fs_column>-r_column->set_cell_editor( lr_checkbox ).
FREE lr_checkbox.
ENDCASE.
ENDLOOP.
Regards,
NS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jitendra
in internal structure (used for the first_display) add one field "checkbox" type flag.
later, modify the catalog table and insert an "X" in the field "CHECKBOX" --> (the catalog field) ....
when you select the checkbox in the 'alv, automatically will be filled with 'X' the field in the internal table
AI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try using class cl_salv_wd_uie_checkbox for making column checkbox
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jitendra Yadav, I have followed your steps , which u have mentioned in d previous blog. http://scn.sap.com/thread/3327930 But still i could not able to get it.. Can u elaborate the steps. Thanks Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.