cancel
Showing results for 
Search instead for 
Did you mean: 

displaying the selected multiple records from node using onleadselect event

Former Member
0 Kudos

Hi all,

How to display the selected multiple records from node to node using onleadselect event.

i came to know tht to fulfill this requirement i need to use the method get_selected_elements,

how to use this method in my event??

sree

Accepted Solutions (1)

Accepted Solutions (1)

saravanan_narayanan
Active Contributor
0 Kudos

I didnt get your question. if you want to get all the selected elements from a node then call if_wd_context_node->get_selected_elements.

BR, Saravanan

Answers (3)

Answers (3)

Former Member
0 Kudos

HI all,

Thanks for the replies. I solved myself before i get the replies. answers rewarded.

thanks

sree

Former Member
0 Kudos

Hi,

Can you please reply us how you have solved the issue. we are facing with the similar issue.

Thanks in advance.

Regards,

Chandran S

Former Member
0 Kudos

Hi Chandran,

What is your requirement? kindly post your question in new post.

Cheers,

Kris.

former_member199125
Active Contributor
0 Kudos

hi Sree,

I think your requirement is to copy the selected records from one table into another table. Am i correct?

If yes, then first retrieve the selected elements using get_selected_elements method, then bind the same to second table( node.)

Okay...

or else you can achieve this by one more way..

place one copy button, in that button action.. write the below

data count type i.

data pos type i value 1.

count = lo_nd_itab1->get_element_count( ).

do count times.

if lo_nd_node1->is_selected( index = pos) = abap_true.

lo_el_node = lo_nd_node1->get_element ( index = pos ).

lo_el_itab1->get_static_Attributes( importing static_attribute = ls_node1 ).

lo_el_node2 = lo_nd_itab->create_element( ).

lo_el_node2->set_Static_attributes( exporting static_attributes = ls_node1 ).

lo_nd_node2->bind_element( new_item = lo_el_node2

set_initial_elements = abap_false ).

pos = pos+1.

enddo

Former Member
0 Kudos

Hi Sree,

Try below code..

DATA : lo_nd_it_lips TYPE REF TO if_wd_context_node,             // This is first node
             lo_el_it_lips TYPE REF TO if_wd_context_element,
             ls_it_lips TYPE wd_this->Element_it_lips,
             lt_it_lips TYPE wd_this->Elements_it_lips.
           DATA: wa_temp TYPE REF TO if_wd_context_element,
            lt_temp TYPE wdr_context_element_set.

* navigate from <CONTEXT> to <IT_LIPS> via lead selection
      lo_nd_it_lips = wd_context->path_get_node( path = `ZRETURN_DEL_CHANGE.CHANGING_3.IT_LIPS` ).

      CALL METHOD lo_nd_it_lips->get_selected_elements
        EXPORTING
            INCLUDING_LEAD_SELECTION = ABAP_true
        RECEIVING
          set = lt_temp.

      DATA lo_nd_pack_mat TYPE REF TO if_wd_context_node.          //Second Node
      DATA lo_el_pack_mat TYPE REF TO if_wd_context_element.
      DATA ls_pack_mat TYPE wd_this->Element_pack_mat.
      DATA lt_pack_mat TYPE wd_this->Elements_pack_mat.
* navigate from <CONTEXT> to <PACK_MAT> via lead selection
      lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).

      lo_nd_pack_mat->get_static_attributes_table( importing table = lt_pack_mat ).

      LOOP AT lt_temp INTO wa_temp.
        CALL METHOD wa_temp->get_static_attributes
          IMPORTING
            static_attributes = ls_it_lips.
              ls_pack_mat-vbeln = ls_it_lips-vbeln.
              ls_pack_mat-material = ls_it_lips-matnr.
              ls_pack_mat-vgbel = ls_it_lips-vgbel.
                append ls_it_lips to lt_unpack.
              CLEAR ls_pack_mat.
       ENDLOOP.

Cheers,

Kris.