cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro Abap ToolBar button in Table

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks a lot..the code worked fine..

Regards,

Anurupa

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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:

http://www.flickr.com/photos/tjung/2784237144/

Former Member
0 Kudos

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.