cancel
Showing results for 
Search instead for 
Did you mean: 

how to select multiple rows of table

Former Member
0 Kudos

Hi All,

I my view i have one table and one button.when i am clicking on the button all the rows of the table will be selected.Can anybody give me an idea how to do this.........

Thanks in Advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

check standard component

WDR_TEST_TABLE

under selction you can find the same functionality you required

Thanks,

Shaik Shadulla

Edited by: shaik shadulla on Jan 29, 2009 9:58 AM

Former Member
0 Kudos

Hi ,

I have same req can you explain it in detail.

Former Member
0 Kudos

Hi,

DATA: lr_element type ref to if_wd_context_element,

lt_elemset type WDR_CONTEXT_ELEMENT_SET.

CALL METHOD lr_node->GET_ELEMENTS "if_wd-context_node

  • EXPORTING

  • FROM =

  • TO =

RECEIVING

SET = lt_elemset .

loop at lt_elemset into lr_element.

CALL METHOD lr_element->SET_SELECTED

EXPORTING

FLAG = 'X'.

clear lr_element.

endloop.

This sets all the elements/rows as selected.

Regards,

Lekha.

Former Member
0 Kudos

Hi,

Set the selection property of the node to 1:N or 0:N first.

Set the selection property of the table as MULTI.

Try out this code -

DATA: lr_element type ref to if_wd_context_element,
      lt_elemset type WDR_CONTEXT_ELEMENT_SET.

CALL METHOD lr_node->GET_ELEMENTS "if_wd-context_node
*  EXPORTING
*    FROM   =
*    TO     =
  RECEIVING
    SET    = lt_elemset .

    loop at lt_elemset into lr_element.

    CALL METHOD lr_element->SET_SELECTED
      EXPORTING
        FLAG   = 'X'.

    clear lr_element.
    endloop.

This sets all the elements/rows as selected.

For More Informtation -

Create a attribute for this selection of type WDUI_TSMODE. Bind the selection property of the table to this attribute.

Then set the Selection property of the table to single initially in the WDDOINIT.

On the button click set the property of the table selection to Multi or Multi-Nolead.

Please chk out this link-

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/6e/ae0e422dfcdc2ce10000000a1550b0/frameset.htm

Check the class cl_wd_table for the selection property and use the methods BIND_SELECTION_MODE.

You will get the reference of the table in the WDDOMOIFY method.

Or use the if_wd_context_node and use the set attirbute method.

Regards,

Lekha.

Edited by: Lekha on Jan 29, 2009 8:05 PM