Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Code for Check Box in ALV Grid Display output

Former Member
0 Kudos

Hi,

Can please give some sample code to get the check boxes in the output of an LAV Grid display.

This check boxes should be editable.

Thanks and regrads

vamshi

Moderator message - Please do not ask or answer FAQs - thread locked

Edited by: Rob Burbank on May 25, 2010 9:30 AM

3 REPLIES 3

Former Member
0 Kudos

hi vamshi,

fill the field cat column as

wa_fieldcat-col_pos = '1'.

wa_fieldcat-tabname = 'IT_OUTPUT'.

wa_fieldcat-fieldname = 'CHECKBOX'.

wa_fieldcat-checkbox = 'X'.

  • wa_fieldcat-input = 'X'.

wa_fieldcat-edit = 'X'.

wa_fieldcat-outputlen = 3.

wa_fieldcat-coltext = 'Chk'.

wa_fieldcat-just = 'X'.

to get checkbox .

Former Member
0 Kudos

hi,

Declare one filed as check box in your final table with length 1.

While populating this field in field cat, set the value 'X' for field check box and edit.

wa_fieldcat-checkbox = c_x.

wa_fieldcat-edit = c_x.

JerryWang
Advisor
Advisor
0 Kudos

Hello vamshi,

The below code is for check box implementation for ALV tree ( although it is not related to your question, but I am sure you also need it in the future

lt_item_layout TYPE lvc_t_layi,
        ls_item_layout TYPE lvc_s_layi,
        is_last_level TYPE abap_bool.

        ls_item_layout-fieldname = mv_tree->c_hierarchy_column_name.
        ls_item_layout-style   = cl_gui_column_tree=>style_intensifd_critical.
        ls_item_layout-class = cl_gui_column_tree=>item_class_checkbox.
        ls_item_layout-editable = 'X'.

Best Regards,

Jerry