cancel
Showing results for 
Search instead for 
Did you mean: 

How to dynamicaly get node name of ui element

glauco
Active Contributor
0 Kudos

Hi friends.

I have the ui element and I need dynamically to get its node name.

How to get it in a dynamic way ?


DATA:
         lr_comp_ctrl   TYPE REF TO cl_wdr_component,
         lr_v_main_ctrl TYPE REF TO cl_wdr_delegating_view,
         lr_v_root_elem TYPE REF TO cl_wd_transparent_container,
         lr_label       TYPE REF TO cl_wd_label,
         lr_uielement   TYPE REF TO cl_wd_uielement,
         lr_context_element TYPE REF TO if_wd_context_element.

   lr_comp_ctrl   ?= p_i_r_comp.
   lr_v_main_ctrl ?= lr_comp_ctrl->get_controller( name = p_i_view_name ).
   lr_v_root_elem ?= lr_v_main_ctrl->get_root_element( ).

   tr_v_elements = lr_v_main_ctrl->get_elements( ).

   LOOP AT tr_v_elements INTO e_element.

*     here !

   ENDLOOP.




Thanks.

Glauco

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

You can use method  BOUND__PRIMARY_PROPERTY( ) which gives the path to which the UI element( primary) property is bound. For ex: value of Input, Text of TextView.. so on..

data lv_path type string.

lv_path = e_element->BOUND__PRIMARY_PROPERTY( ).

This gives the path as NODE.ATTR " here NODE is the Node which you are looking for! You can use string opration to get the value 'NODE' . Note that you need to read the string from last to get the Node. For ex if it is a deep node, say PARENT.CHILD.ATTR " then your node is CHILD. So get the Node value from the last occurrence of dot(.) to the next dot(.)

hope this helps,

Regards,

Kiran

Answers (0)