Skip to Content
author's profile photo
Former Member

Select All in table

Hi all,

I have a table, with some data. for futher step i have to select all records in that table, in case user forget to select, i have

to select dynamycally. how can we acieve this?

Thanks,

Venkat.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Posted on May 04, 2011 at 05:38 AM

    Hi,

    You have to use set_select method to select, check below code..

    • To Get No of records that it_lips node contains

    DATA lo_nd_it_lips1 TYPE REF TO if_wd_context_node.

    DATA int TYPE i VALUE 1.

    DATA count TYPE i.

    • navigate from <CONTEXT> to <IT_LIPS> via lead selection

    lo_nd_it_lips1 = wd_context->path_get_node( path = `ZRETURN_DEL_CHANGE.CHANGING_3.IT_LIPS` ).

    count = lo_nd_it_lips1->get_element_count( ).

    • To get Select All in it_lips table.

    DO count TIMES.

    lo_nd_it_lips1->set_selected(

    flag = abap_true

    index = int ).

    ADD 1 TO int.

    ENDDO.

    Cheers,

    Kris.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on May 04, 2011 at 05:36 AM

    HI,

    Somthing like this will work.

    Get all elements, loop through each element and set the selected to abap_true.

    DATA lo_nd_main TYPE REF TO if_wd_context_node.
    
      DATA lo_el_main TYPE REF TO if_wd_context_element.
      DATA lt_el_set  TYPE WDR_CONTEXT_ELEMENT_SET.
      DATA ls_el_set_wa LIKE LINE OF lt_el_set.
    
    * navigate from <CONTEXT> to <MAIN> via lead selection
      lo_nd_main = wd_context->get_child_node( name = wd_this->wdctx_main ).
    
    
    * get all elements
      lt_el_set = lo_nd_main->get_elements( ).
    
      LOOP AT lt_el_set INTO ls_el_set_wa.
        ls_el_set_wa->SET_SELECTED( flag = abap_true ).
        CLEAR ls_el_set_wa.
      ENDLOOP.

    Thanks,

    Aditya.

    Add comment
    10|10000 characters needed characters exceeded