cancel
Showing results for 
Search instead for 
Did you mean: 

To get node by node info

Former Member
0 Kudos

Hi,

I am creating context nodes and attributes dynamically.

After setting values to atttributes i need to get all info back.

is there any way, i can iterate to nodes one by one and get all attribute values.

Below is the kind of structure

root_node

1.node1

attr1

attr2

2.node2

attr3

attr4

please help.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi vimal...

you can make use of the class if_wd_context_node... the methods in this will provide witht the information you need.

ex:

get_attribute,

get_child_nodes returns all the child nodes in a node.

---regards,

alex b justin

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

see the code...

data:

lr_screen_node type ref to if_wd_context_node,

lr_screen_node_carrid type ref to if_wd_context_node,

lt_sflight TYPE STANDARD TABLE OF sflight,

w_sflight like line of lt_sflight,

itemlist type standard table of if_view3=>element_sflight_carrid,

w_screen like line of itemlist,

v_text type string,

v_text1 type string,

v_text2 type dats,

v_text3 type n,

v_index type i,

v_text4 type string.

*set values to attribute..

lr_screen_node = wd_context->get_child_node( 'node1' ).

lr_screen_node->GET_STATIC_ATTRIBUTES_TABLE( importing table = itemList ).

v_Index = lr_screen_node->GET_LEAD_SELECTION_INDEX( ).

clear w_screen.

read table itemList into w_screen index v_Index.

v_Text4 = w_screen-value.

select connid from sflight into v_text1 WHERE carrid = v_text4.

wd_Context->set_Attribute( exporting value = v_Text1 NAME = 'attr1' ).

w_sflight-connid = v_text1.

endselect.

*get attribute...

lr_screen_node = wd_context->get_child_node( 'node1' ).

lr_screen_node->get_attribute( EXPORTING name = 'attr2' IMPORTING value = v_text ).

w_sflight-carrid = v_text.

reward me if this helps you..

Edited by: Shyja on Jan 29, 2008 3:39 AM

Edited by: Shyja on Jan 29, 2008 3:42 AM