cancel
Showing results for 
Search instead for 
Did you mean: 

Issue reading Child Node Values(Dropdown)

Former Member
0 Kudos

Hi Experts,

I have a child node for my table node which in turn has a grand child node which is used to populate the dropdown in my table. Now the issue is when i wish to save the table details which has 5 normal fields and 1 dropdown field i am trying to read the grand child values using "get static attributes table" which doesnt give me the current nor the correct values.

Could some one please throw some light on how to read data from a child node(used to populate dropdown by index) within a table node.

P.S: When i do a"get static attributes table" on the parent node it doesnt include the fields that are their in its child nodes , is there a way around this?

Thanks In Advance,

Chaitanya.

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

get_static_attributes* methods return only the attributes of an element(node)

to access child node's attributes you have to get the child node reference from the parent element(node)

and then access its attributes.

Node ( with cardinality 0..n ) holds Elements. Each element is a one record of a table.

data: lr_parent type ref to if_wd_context_node.

data: lt_parent type wdr_context_element_set.

data: ls_parent type <type of parent context node structure>.

data: lr_elem_parent type ref to if_wd_cotnext_element.

data: lr_child type ref to if_wd_context_node.

data: lr_elem_child type ref to if_wd_context_element.

data: ls_child type <type of child node structure>.

lr_parent = wd_cotnext->get_child_node( 'PARENT' ).

lt_parent = lr_parent->get_elements( ).

loop at lt_parent to lr_elem_parent.

lr_elem_parent->get_static_attributes( importing static_attributes = ls_parent ).

lr_child = lr_elem_parent->get_child_node( 'CHILD' ).

lr_elem_child = lr_child->get_lead_selection( ).

lr_elem_child->get_static_attributes( importing static_attributes = ls_child ).

endloop.

the loop fetches every record that the parent consists and stores in ls_parent,

to find the ls_parent's corresponding child's lead selection will be in ls_child.

hope it is clear

Abhi

Answers (0)