Hi, I provide training in SAP UI5. Also feel free to checkout my new web page https://saptechblog.com
Webdynpro ABAP

Multiple lead selection in Table

In the following post we are going to see how to read all the lead selected attributes when the multiple lead selections for the table UI element is provided.

Before we proceed with reading the multiple lead selected attributes lets ensure that the multiple lead selections property is set for the context node.

Ensure that the context node binded to the table UI element is of cardinality 0..N.

clip_image002

 

 

Also ensure that the property of the table UI element is as below.

clip_image004

Write the following code to read all the lead selected attributes.

Code:

  DATA : lo_nd_ekko  TYPE REF TO  if_wd_context_node,
         lt_ekko    
TYPE        
wd_this->elements_ekko,
         ls_ekko    
TYPE        
wd_this->element_ekko,
         it_selected
TYPE        
wdr_context_element_set,
         wa_selected
LIKE LINE OF
it_selected.

* Getting the object reference of the node EKKO

  lo_nd_ekko = wd_context->get_child_node( name = wd_this->wdctx_ekko ).


* Get the element object reference of all the lead selected attributes
 
CALL METHOD lo_nd_ekko->get_selected_elements
    RECEIVING
     
set                     
= it_selected
      .



* Looping the lead selected object reference and collecting its data in the internal table

 
LOOP AT it_selected INTO wa_selected.

   
CALL METHOD
wa_selected->get_static_attributes
     
IMPORTING

        static_attributes = ls_ekko.

   
APPEND ls_ekko TO lt_ekko.
   
CLEAR
ls_ekko.

  ENDLOOP.



* Binding the collected values back to the table.

  lo_nd_ekko->bind_table( new_items = lt_ekko set_initial_elements = abap_true ).

 

Output:

Select some leads and click on display.

clip_image006

 

clip_image008

About Arun

0 Comments:

Post a Comment

Powered by Blogger.