Skip to Content

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

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

    1. sachin yadav 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

      (0) 

Leave a Reply