on 08-21-2008 8:16 AM
hi,
I have a table with 4 columns in my view, i need a toolbar button "SELECT ALL" such that wen they user clicks on this button , all the rows in the table which contain records get selected.
Can anyone help me with the coding for the onAction of this toolbar button??
Regards,
Anurupa
In the onaction method of the button, add the following piece of code
data : count TYPE i.
count = lo_nd_spfli_table->get_element_count( ).
do count TIMES.
lo_nd_spfli_table->set_selected( EXPORTING flag = 'X'
index = count ).
count = count - 1.
enddo.
"lo_nd_spfli_table is the node reference binded to the table
Regards
Tamil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the later support packages SAP has added this select-all function directly into the table UI element. You just click on the little icon in the upper left hand corner of the table:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anurupa,
I am putting some way to select all table rows. you can do it without using counter also.
Please follow the code, please
Let me know If you need any more help.
METHOD onactionselect_all .
DATA : lo_nd_pr_items TYPE REF TO if_wd_context_node,
lo_nd_pr_items_el_set TYPE wdr_context_element_set,
ls_pr_items LIKE LINE OF lo_nd_pr_items_el_set.
Read Event parameters
lo_nd_pr_items = wd_context->get_child_node( 'PR_ITEMS_NEW' ).
***Get the list of elements in node PR_ITEMS
CALL METHOD lo_nd_pr_items->get_elements
RECEIVING
set = lo_nd_pr_items_el_set.
Set the selected property to true.
LOOP AT lo_nd_pr_items_el_set INTO ls_pr_items .
ls_pr_items->set_selected( flag = abap_true ).
ENDLOOP.
ENDMETHOD.
Regards
Satrajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.