Application Development and Automation 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: 
Read only

How to add checkbox on node level?

Former Member
0 Likes
582

How to add checkbox on node level?

I am able to display checkbox on the last child node but not able to show checkbox on node level.

This is how I declare at fieldcatalog .

ls_fieldcat-fieldname   = 'APP1'.
   ls_fieldcat-coltext   = 'Approver1'.
   ls_fieldcat-col_pos     = 6.
   ls_fieldcat-checkbox    = 'X'.
   ls_fieldcat-edit        = ' '.
   append ls_fieldcat to gt_fieldcat.
   clear  ls_fieldcat.

Please advice.

Thanks,

Wong

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
555

I got it.

In order to add checkbox on every node,

     Under every call method g_alv_tree->add_node    

          add it_item_layout   = lt_item_layout1

                    lt_item_layout1 will be something like this

   ls_item_layout-fieldname = 'APP1'.
   ls_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
   ls_item_layout-editable = 'X'.
   append ls_item_layout to lt_item_layout1.
This will show display the check boxes.

How to add checkbox on node level?

I am able to display checkbox on the last child node but not able to show checkbox on node level.

This is how I declare at fieldcatalog .

ls_fieldcat-fieldname   = 'APP1'.
   ls_fieldcat-coltext   = 'Approver1'.
   ls_fieldcat-col_pos     = 6.
   ls_fieldcat-checkbox    = 'X'.
   ls_fieldcat-edit        = ' '.
   append ls_fieldcat to gt_fieldcat.
   clear  ls_fieldcat.

Please advice.

Thanks,

Wong

2 REPLIES 2
Read only

Former Member
0 Likes
555

Hello Wong,

you can try this:

http://help.sap.com/saphelp_nw04/helpdata/en/26/46fb40f17af66fe10000000a1550b0/content.htm

or use the styles field of the layout structure to use a field as an checkbox.

-Nico

Read only

Former Member
0 Likes
556

I got it.

In order to add checkbox on every node,

     Under every call method g_alv_tree->add_node    

          add it_item_layout   = lt_item_layout1

                    lt_item_layout1 will be something like this

   ls_item_layout-fieldname = 'APP1'.
   ls_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
   ls_item_layout-editable = 'X'.
   append ls_item_layout to lt_item_layout1.
This will show display the check boxes.