Skip to Content
Author's profile photo Sachinkumar Yadav

Select multiple rows in table without using Ctrl key.

1)      1) Create a table in view. Bind it with the context node.

2)      2) Write code in WDDOINIT to populate the table with data. Wizard can be used for the same.

3)      3) For multiple selection Please select the node properties as below

sfs    

           /wp-content/uploads/2013/11/1_312603.jpg

1)      4)Set the below two properties of table.

       selectionChangeBehaviour as manual and selectionMode as Multi.

/wp-content/uploads/2013/11/2_312604.jpg

         5) Implement the action Onselect.

/wp-content/uploads/2013/11/3_312608.jpg

While creating the action doesn’t forget to select the check box “”Copy UI Event Parameters”

/wp-content/uploads/2013/11/4_312609.jpg

1)   6)   Implement below code in on_select action

DATA lv_index TYPE i,                        “Index of the selected row.
          lo_node
TYPE REF TO if_wd_context_node. “Conext Node

*New_lead_selection will come automatically once you select* “Copy UI Event Parameters” while creating action
*Get the index of the selected row
  lv_index  
= new_lead_selection->get_index( ).
*Get the referance for Node
  lo_node
= NEW_LEAD_SELECTION->get_node( ).

*If row is already selectd for that particular index*then unselect that row else select that row
 
IF lo_node->is_selected( index = lv_index ) = abap_true.
    lo_node
->set_selected( flag = abap_false index = lv_index ). ” Deselect
 
ELSE.
    lo_node
->set_selected( index = lv_index ). ” Select
 
ENDIF.

7) Output

/wp-content/uploads/2013/11/5_312614.jpg

1

Assigned tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Kiran Kumar Valluru
      Kiran Kumar Valluru

      Isn't this the same explained in this document already? http://scn.sap.com/docs/DOC-28915

      Author's profile photo sachin yadav
      sachin yadav
      Blog Post Author

      Dear Kiran,

      Thanks for your review comments, but the step 4 (Set the below two properties of table.) was missing in the document which you have mentioned.

      Regards

      Sachin

      Author's profile photo Former Member
      Former Member

      😎 Great!!

      The key point is selectionChangeBehaviour as manual