Skip to Content
author's profile photo Former Member
Former Member

To get node by node info

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 11:53 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 02:38 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.