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

Expand tree in WebDynpro ABAP application

Hi,

Currently I am working on a WDA application which contains a UI ELEMENT TREE. The tree is generated dynamically at runtime.

I was guided by the example of SAP "WDT_TREE". After generating the tree looks like this:

TREE
   | __ NODE1
           | __ LEAF1
           | __ LEAF2
           | __ NODE2
                | __ LEAF3
           | __ Node3
                | __ LEAF4
                | __ LEAF5
                | __ LEAF6

Now I have bound the "expanded" property of the node to a context element and execute the following action in the WDDOINIT:

* Fill tables with the structure of the tree
  fill_foldertable( ).
  fill_filetable( ).

  lr_current_node    = wd_context->get_child_node( 'FOLDER' ).
  lr_current_element = lr_current_node->create_element( ).
  lr_current_node->bind_element( lr_current_element ).
  lr_current_node->set_lead_selection( lr_current_element ).

  lr_current_element->set_attribute( name = 'TEXT' value = 'Products' ).
 lr_current_element->set_attribute( name = 'IS_EXPANDED' value = 'X' ).

* Create the root node
  create_node(
    EXPORTING
      cur_element = lr_current_element
      parent_key  = 'Categories' ).

Now the tree is expanded, but i can't see EAF1 and LEAF2. I get them only by clicking again on node1.

Any ideas?

Regards.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 28, 2010 at 07:51 AM
    lr_current_node    = wd_context->get_child_node( 'FOLDER' ).
      lr_current_element = lr_current_node->create_element( ).
    
    lr_current_element->set_attribute( name = 'IS_EXPANDED' value = 'X' ).

    You have set the expnaded property for the parent node.

    Ensure that you repeat the code even for child nodes. This should expand the child nodes of the tree.

    Regards,

    Sharath

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 29, 2010 at 04:17 PM

    Hi,

    For your requirement please check the standard webdynpro component WDR_TEST_EVENTS

    check the application you can find at the left side the tree, check which is suitable for your requirement.

    See the related logic will hlep you.

    Regards,

    Naresh Kumar.

    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.