Searching Hierarchical tree using Find tree node

In hierarchical tree using find_tree_node when i search the value it is taking the search value as a string and returns the node that of previous node value. for example
Suppose when i am searching for node value 18 ,but it takes the some other node value of (1883).
The tree structure is
1
2
1883
3
18
The code used is
p_node := ftree.get_tree_node_property ('tree_block.tree',:system.trigger_node,ftree.node_value);
current_node := Ftree.Find_Tree_Node(htree,
     p_node,
     Ftree.FIND_NEXT,
     Ftree.NODE_VALUE,
     Ftree.ROOT_NODE,
          Ftree.ROOT_NODE);

Hi!
You can use your restricting subquery in a start with clause. Something like
start with node_parent is null and some_field in (select ...)
Or you can eliminate the join and use where clause.
Hope this helps.
Sergey.

Similar Messages

  • How to display xml sting as tree , using af:tree

    Hi, i need to display a xml string stored in the data base table, as a xml tree in GUI.
    I understand ADF having a component called <af:tree> . It expects input data as "oracle.adf.view.faces.model.TreeModel" type.
    how to convert the string format of xml stored in the database , to the required type " "oracle.adf.view.faces.model.TreeModel"".
    Is there any examples to do this. Thanks .
    ganesh

    Thanks for the post.
    I looked at the link , before posting my question. That;s not i what i want. It says,
    The Oracle ADF Framework includes a Data Control for URL Services (a.k.a URL Service Data Control). The URL Service Data Control provides the ability to access files (CSV, XML) through a URL. You can also utilize this Data Control to access Servlets and JSPs that return simple, textual data such as XML data. In this How To, the URL Service Data Control will be used to access the JDeveloper RSS News feed and present that data within a Rich Client Interface. You will need JDeveloper 11g, available from OTN, to give this a try. Also provided is the Application that is utilized in this How-To.
    But what i want is entirely different than URL data control.
    A table is having xml file as string (The size can go upto 1 mb. )
    In the GUI i need to display it as tree.

  • Cannot search NFS shares using finder

    Having connected ubuntu 11.04 NFS4 share, searching in finder apparently doesn't do anything.
    Search works fine when the same folder is mounted using SMB or AFP.
    Tested using two different OSX machines both running 10.6.8.
    Does it work for anyone here?

    correction. it's just regulrarly mounted using nfs3.
    apparently no one is using nfs here at all

  • Cannot expand tree nodes using t:tree tag

    Hi, I have a question.
    I am a beginner of JSF. I am trying to deploy a very simple tree using <t:tree> in my local tomcat server, similar to the following one:
    http://www.irian.at/myfaces/tree.jsf
    The result is that the tree is properly displayed, but I cannot expand the nodes when I click on the "+" icon of the nodes.
    Can someone help me? Thanks a lot!

    Take a look at Lilya Jsf Widgets and Ajax Capabilities at http://qlogic.ma/lilya
    the new era of technology

  • Command link used as tree node

    I'm using an ADF Tree where one of my nodes is a command link. I've given the link an id="myLink".
    When I run the page, the tree shows up fine with just one node.
    But the View Page source does not contain any entry that says id="mylink".
    Where could be the problem?
    Thanks
    RV

    Hi,
    I assume you use ADF Faces RC, because otherwise you would have posted this to the JDeveloper forum. If you add a command link t a node, then this command link is used for any node that is rendered for the tree (unless you implemented it in a way that only has exactly one command link component showing in the whole tree - which I don't think you have).
    In JSF you cannot have more than one component with a specific ID, which means that assigning an ID to a command link in a tree doesn't make much sense.
    In ADF Faces RC, trees are active components, which means they are created in the DOM and not HTML. So using a DOM inspector like Firebug you should see your tree and link components
    <a id="j_id___jsp_tag_ctru4:7:myLink" class="xdk" href="#" onclick="return false;">commandLink 1</a>
    Frank

  • Selecting/highlighting a node in Flex Tree using HierarchicalCollectionView as DataProvider

    Hi,
    I am using GroupingCollection2 as the dataprovider for HierarchicalCollectionView. The GroupingCollection2 takes its data from an ArrayCollection. And finally I have a Tree whose dataprovider is the HierarchicalCollectionView . I want to acheive 2 things:
    1) I want to programatically select/highlight a node in this tree. Using expandItem and passing the Object from the arraycollection is not working.
    2) Refresh the tree if there is a change in the arrayCollection.
    For the second task, I have a Java Layer that gives me the ArrayCollection  (dp for GroupingCollection2) when I fire a CairngormEvent. But the problem is that every node in the tree is duplicated. I can clearly see that say there are 8 items in the array collection but still the tree shows 16 items ( Each item duplicated as the node in the tree.)
    I have been trying to figure this out for many days now without any luck. Any sort of suggestion would be appreciated.
    Thank u in advance.

    I got the refreshing of the tree part by myself. One needs to call the refresh method on the GroupingCollection2 and HierarchicalCollectionView objects when the arraycollection has just arrived from the database.
    But I still havent been able to figure out how to highlight or open a tree node programatically. I am repeating that using (calling / setting) tree.expandItem() and tree.openItems is not helping me. Plz somebody help.

  • Listing File Hierarchy in console using a Tree structure

    first off i'm a college student. i'm not that good at java... we got this CA in class and try as i might i just can't get my head around it
    i was wondering if someone who know a bit more about java then i do would point me in the right direction, were i'm going wrong in my code
    i have to list out sub-files and sub-directorys of a folder (i.e. C:/test) to console using tree structure
    like this
    startingdir
    dir1 //subfolder of startingdir
    dir11 //subfolder of dir1
    dir111 //subfolder of dir11
    dir12 //subfolder of dir1
    file1A // document on dir1
    dir2 //subfolder of startingdir
    Tree.java
    import java.util.Iterator;
    import java.util.LinkedList;
    import java.util.ListIterator;
    import java.util.NoSuchElementException;
    import java.util.Deque;
    public class Tree<E> {
        // Each Tree object is an unordered tree whose
        // elements are arbitrary objects of type E.
        // This tree is represented by a reference to its root node (root), which
        // is null if the tree is empty. Each tree node contains a link to its
        // parent and a LinkedList of child nodes
        private Node root;
        //////////// Constructor ////////////
        public Tree () {
        // Construct a tree, initially empty.
            root = null;
        //////////// Accessors ////////////
        public boolean isEmpty () {
        // Return true is and only if this tree is empty.
             return (root == null);
        public Node root () {
        // Return the root node of this tree, or null if this tree is empty.
            return root;
        public Node parent (Node node) {
        // Return the parent of node in this tree, or null if node is the root node.
            return node.parent;
        public void makeRoot (E elem) {
        // Make this tree consist of just a root node containing element elem.
            root = new Node(elem);
        public Node addChild (Node node, E elem) {
        // Add a new node containing element elem as a child of node in this
        // tree. The new node has no children of its own. Return the node
        // just added.
            Node newChild = new Node(elem);
            newChild.parent = node;
            node.children.addLast(newChild);
            return newChild;
        public E element (Node node) {
             return node.getElement();
        //////////// Iterators ////////////
        public Iterator childrenIterator (Node node) {
            return node.children.iterator();
        public Iterator nodesPreOrder () {
        // Return an iterator that visits all nodes of this tree, with a pre-order
        // traversal.
            return new Tree.PreOrderIterator();
        //////////// Inner classes ////////////
        public class Node {
            // Each Tree.Node object is a  node of an
            // unordered tree, and contains a single element.
            // This tree node consists of an element (element),
            // a link to its parent
            // and a LinkedList of its children
            private E element;
            private Node parent;
            private LinkedList<Node> children;
            private Node (E elem) {
                // Construct a tree node, containing element elem, that has no
                // children and no parent.
                this.element = elem;
                this.parent = null;
                children = new LinkedList<Node>();
            public E getElement () {
            // Return the element contained in this node.
                return this.element;
            public String toString () {
            // Convert this tree node and all its children to a string.
                String children = "";
                // write code here to add all children
                return element.toString() + children;
            public void setElement (E elem) {
            // Change the element contained in this node to be elem.
                this.element = elem;
        public class PreOrderIterator implements Iterator {
            private Deque<Node> track; //Java recommends using Deque rather
            // than Stack. This is used to store sequence of nomempty subtrees still
            //to be visited
            private PreOrderIterator () {
                track = new LinkedList();
                if (root != null)
                    track.addFirst(root);
            public boolean hasNext () {
                return (! track.isEmpty());
            public E next () {
                Node place = track.removeFirst();
                //stack the children in reverse order
                if (!place.children.isEmpty()) {
                    int size = place.children.size(); //number of children
                    ListIterator<Node> lIter =
                            place.children.listIterator(size); //start iterator at last child
                    while (lIter.hasPrevious()) {
                        Node element = lIter.previous();
                        track.addFirst(element);
                return place.element;
            public void remove () {
                throw new UnsupportedOperationException();
        FileHierarchy.java
    import java.io.File;
    import java.util.Iterator;
    public class FileHierarchy {
        // Each FileHierarchy object describes a hierarchical collection of
        // documents and folders, in which a folder may contain any number of
        // documents and other folders. Within a given folder, all documents and
        // folders have different names.
        // This file hierarchy is represented by a tree, fileTree, whose elements
        // are Descriptor objects.
        private Tree fileTree;
        //////////// Constructor ////////////
        public FileHierarchy (String startingDir, int level) {
            // Construct a file hierarchy with level levels, starting at
            // startingDir
            // Can initially ignore level and construct as many levels as exist
            fileTree = new Tree();
            Descriptor descr = new Descriptor(startingDir, true);
            fileTree.makeRoot(descr);
            int currentLevel = 0;
            int maxLevel = level;
            addSubDirs(fileTree.root(), currentLevel, maxLevel);
        //////////// File hierarchy operations ////////////
        private void addSubDirs(Tree.Node currentNode, int currentLevel,
                int maxLevel) {
        // get name of directory in currentNode
        // then find its subdirectories (can add files later)
        // for each subdirectory:
        //    add it to children of currentNode - call addChild method of Tree
        //    call this method recursively on each child node representing a subdir
        // can initially ignore currentLevel and maxLevel   
            Descriptor descr = (Descriptor) currentNode.getElement();
            File f = new File(descr.name);
            File[] list = f.listFiles();
            for (int i = 0; i < list.length; ++i) {
                if (list.isDirectory()) {
    File[] listx = null;
    fileTree.addChild(currentNode, i);
    if (list[i].list().length != 0) {
    listx = list[1].listFiles();
    addSubDirs(currentNode,i,1);
    } else if (list[i].isFile()) {
    fileTree.addChild(currentNode, i);
    // The following code is sample code to illustrate how File class is
    // used to get a list of subdirectories from a starting directory
    // list now contains subdirs and files
    // contained in dir descr.name
    ////////// Inner class for document/folder descriptors. //////////
    private static class Descriptor {
    // Each Descriptor object describes a document or folder.
    private String name;
    private boolean isFolder;
    private Descriptor (String name, boolean isFolder) {
    this.name = name;
    this.isFolder = isFolder;
    FileHierarchyTest.javapublic class FileHierarchyTest {
    private static Tree fileTree;
    public static void main(String[] args) {
    FileHierarchy test = new FileHierarchy ("//test", 1);
    System.out.println(test.toString());

    Denis,
    Do you have [red hair|http://www.dennisthemenace.com/]? ;-)
    My advise with the tree structure is pretty short and sweet... make each node remember
    1. it's parent
    2. it's children
    That's how the file system (inode) actually works.
    <quote>
    The exact reasoning for designating these as "i" nodes is unsure. When asked, Unix pioneer Dennis Ritchie replied:[citation needed]
    In truth, I don't know either. It was just a term that we started to use. "Index" is my best guess, because of the
    slightly unusual file system structure that stored the access information of files as a flat array on the disk, with all
    the hierarchical directory information living aside from this. Thus the i-number is an index in this array, the
    i-node is the selected element of the array. (The "i-" notation was used in the 1st edition manual; its hyphen
    became gradually dropped).</quote>

  • Searching for a certain  binary tree from another tree........

    I have been struggling for a tree search problem for a good while. Now I decide to ask you experts for a better solution :-).
    Given a binary tree A. We know that every Node of A has two pointers. Leaves of A can be tested by if(node.right = =node). Namely, The right pointer of every leaf node points to itself. (The left pointer points to the node sits on the left side of the leaf in the same depth. and the leafmost node points to the root. I do no think this information is important, am i right?).
    Tree B has a similar structure.
    The node used for both A and B.
    Node{
    Node left;
    Node right;
    My question is how to test if tree B is a subtree of A and if it is, returns the node in A that corresponds to the root of B. otherwise, return null.
    So, the method should look like:
    public Node search(Node rootOfA, Node rootOfB){
    I know a simple recursive fuction can do the job. The question is all about the effciency....
    I am wonderring if this is some kind of well-researched problem and if there has been a classical solution.
    Anyone knows of that? Any friend can give a sound solution?
    Thank you all in advance.
    Jason
    Message was edited by:
    since81

    I'm not too sure if this would help but there goes.
    I think a recursive function will be the easiest to implement (but not the most efficient). In terms of recursive function if you really want to add performance. You could implement your own stack and replace the recursive function with the use of this stack (since really the benefit of recursive function is that it manages its own stack). A non-recursive function with customized well implemented stack will be much more efficient but your code will become more ugly too (due to so many things to keep track of).
    Is tree B a separate instance of the binary tree? If yes then how can Tree B be a subset/subtree of tree A (since they are two separate "trees" or instances of the binary tree). If you wish to compare the data /object reference of Tree B's root node to that of Tree A's then the above method would be the most efficient according to my knowledge. You might have to use a Queue but I doubt it. Stack should be able to replace your recursive function to a better more efficient subroutine but you will have to manage using your own stack (as mentioned above). Your stack will behave similar to the recursive stack to keep track of the child/descendant/parent/root node and any other references that you may use otherwise.
    :)

  • 10g form tree use of sys variable SYSTEM.TRIGGER_NODE issues

    I have a tree that I have put on a search box to navigate the tree and select nodes on the tree based on the search string.
    The problem is that if they use the search box :SYSTEM.TRIGGER_NODE is not populated.
    I use a search on the tree and then
    ftree.set_tree_selection(tree_item, find_node, ftree.SELECT_ON); to select the item but how do I get this to set the trigger node variable?
    If I mouse click nodes its populated correctly but not if I use the above
    I use system.trigger node in various places to get current node to add/remove things to tree so ideally want to use this - as i thought this was always populated when the node was selected.
    Thanks in advance

    Quoting the online documentation for the WHEN-TREE-NODE-SELECTED Trigger:
    SYSTEM.TRIGGER_NODE is the node the user clicked on. SYSTEM.TRIGGER_NODE returns a value of type NODE.
    No programmatic action will cause the When-Tree-Node-Selected trigger to fire. Only end-user action will generate an event.So your programmatic setting of the trigger node does not cause the trigger to fire, so :system.trigger_node is not populated. But the value what you think :system.trigger_node should be in your case would be find_node , isn't it?
    cheers

  • Building tree using view crateria in view objects

    suppose that i have the following tables "class" ,"group" and "item".
    items in table "item" belong to groups in table "group" and groups belong to classes in table "class" .
    suppose there is another table called "selling_basket" that contains an id for the customer and also a foreign key for rows in item table for the items he sold and a "Customer" table that contains customers id and other informations.
    suppose that i want to build an JSF page that contains a table from a view based on the "customer" table and a tree of herarichy - class
    |_group1
    |_item1
    |_item2
    -class2
    |_group2
    |_item3
    |_group3
    and when i click on a row on table customer the tree only display the herarichy for items that this customer sold just.

    i solve the probel the description as follow :
    . the problem : the problem is that when we use the tree model component with the scenario of filtration on the child nodes, we do a normal transactions of steps on the knowledge that the tree will use the master detail behavior as in table component and other ADF Master-details behaviors, so we build two view criteria one on employee and the other on department with the scenario of displaying only the department who has employees with salary equal some certain value, and only shows the employees who has salary equal that value, and on our code we apply the two criteria on the two view objects with the same value we entered to search for , the scenario works well for the top level nodes, but for child nodes it seems it doesn’t work, the behavior make us walk around our selves for why this happened. By debugging options and Tracing what SQL statements that it executes we found that the system execute two statements on the employee view object one with the bind value with the same we inserted and the other with null value, and we notice that the name of the second view object executed is not what we apply the view criteria for(departmentEO_employeeEO_emo_dept_FK_employeeView).
    .The solution: we notice that the tree component doesn’t use master detail behavior as in tables, and instead of that it uses the View link assessors (the run time generated view object departmentEO_employeeEO_emo_dept_FK_employeeView ), to get the detailed items, so we should override the action of the View link assessor.
    To deal with that we generate the view object rowimpl and viewimpl java classes, in the rowimpl class there is a method to call the link assessors with the following code:
    public RowIterator getEmployeesView()
    this.getAttributeInternal(EMPLOYEESVIEW);
    We write our code:
    public RowIterator getEmployeesView()
    System.out.println("Here");
    ViewObject s=((DepartmentsViewImpl)this.getViewObject()).getViewLinks()[0].getDestination();//we get the employee object by using the view link
    // between department and employee
    // then we apply the view criteria to that view object and return it as view link
    System.out.println("row number "+s.getEstimatedRowCount());
    ViewCriteria evc=s.getViewCriteriaManager().getViewCriteria("EmployeesViewCriteria");
    s.ensureVariableManager().setVariableValue("nSal",((DepartmentsViewImpl)this.getViewObject()).getnSal());
    s.applyViewCriteria(evc);
    s.executeQuery();
    return s;
    Notice that we use the employee view object getted by the view link instead of the master details.
    Regards
    Mohammad.b.yaseen
    Sep 26 2011 @ 11:43
    J2EE Team
    RealSoft
    for more info this the application url :
    http://www.4shared.com/file/lgeaYWXa/TreeTestApplication1.html
    notice that i diidn't attach the database with the project so you can connect to the local db
    Edited by: mohammad.j.b.yaseen on Sep 26, 2011 12:13 PM

  • JDev10g: Using a Tree component based on different queries.

    Hello,
    I've been doing some research on how to implement a tree component in ADF which I got working. However I need to implement a tree component that uses several different queries.
    The parent node would be one query, the child/leaf nodes would be based on another query but still related to the parent.
    For Example: 'select parent_nodes from mydatabase' then 'select child_nodes from mydatabase where child_nodesID = parent_nodesID'
    This will ultimately have to branch down more levels but I'm not sure exactly how to achieve this. I'm thinking I have to create new View Objects but I'm not sure exactly how to do that either.
    Thank you in advance.

    For an SQL query on a database use a View Object. First, you will need to create a new Entity object to represent each table in the database you need to use in the queries. Once you have created your view objects with their correct SQL queries, you need to specify how they are related. Example:
    RootView is all elements with ParentId of null.
    OtherView is all elements with ParentId not null.
    RootToOtherLink is a view link which links RootView.Id to OtherView.ParentId. You can specify this in the dialog. You will want to select all accessors available to make your life easier later, but make sure to name them something you will recognize, like "RootToOtherDestination".
    You will also need OtherToOther Link which links OtherView.Id to OtherView.ParentId. This starts the recursive nature of the hierarchical relationship.
    Once you have this set up, you will need to create an Application Module so that you have a data control you can bind your tree to. Set up the data model in a hierarchical fashion using your link.
    This will create a data control on the Data Controls pane you can drag onto your .jspx page. A menu will show up from which you can select tree component. This will take you to the tree binding dialog. Here is where all your work so far will pay off. You want to click the green plus button to add your RootView. Then, with the RootView selected you will want to hit the green plus again to select your destination accessor, such as "RootToOtherDestination" as mentioned earlier. This will show the OtherView as a child of the RootView. Finally, with OtherView selected you will want to hit the green plus again and select your other destination accessor, such as "OtherToOtherDestination". Select the attributes you want to have available to your tree at the bottom of the dialog and click ok.
    Your tree will show up. If you want to customize the way it looks or especially the attributes it displays in a node, those can be edited in the <af:tree> tag on your .jspx page.

  • ALV Tree using Function Modules

    Hi,
    I want a simple example of ALV Tree using Function Modules which can display multiple Columns in the Hierarchically arranged fashion along with nodes & icons.
    Also should be able to handle the events.
    Thanks in Advance..

    Hi Ramesh,
    Here is a example of alv tree
    *& Report  BCALV_TREE_DEMO                                             *
    report  bcalv_tree_demo.
    class cl_gui_column_tree definition load.
    class cl_gui_cfw definition load.
    data tree1  type ref to cl_gui_alv_tree.
    data mr_toolbar type ref to cl_gui_toolbar.
    include <icon>.
    include bcalv_toolbar_event_receiver.
    include bcalv_tree_event_receiver.
    data: toolbar_event_receiver type ref to lcl_toolbar_event_receiver.
    data: gt_sflight      type sflight occurs 0,      "Output-Table
          gt_fieldcatalog type lvc_t_fcat, "Fieldcatalog
          ok_code like sy-ucomm.           "OK-Code
    start-of-selection.
    end-of-selection.
      call screen 100.
    *&      Module  PBO  OUTPUT
    *       process before output
    module pbo output.
      set pf-status 'MAIN100'.
      if tree1 is initial.
        perform init_tree.
      endif.
      call method cl_gui_cfw=>flush.
    endmodule.                             " PBO  OUTPUT
    *&      Module  PAI  INPUT
    *       process after input
    module pai input.
      case ok_code.
        when 'EXIT' or 'BACK' or 'CANC'.
          perform exit_program.
        when others.
          call method cl_gui_cfw=>dispatch.
      endcase.
      clear ok_code.
      call method cl_gui_cfw=>flush.
    endmodule.                             " PAI  INPUT
    *&      Form  build_fieldcatalog
    *       build fieldcatalog for structure sflight
    form build_fieldcatalog.
    * get fieldcatalog
      call function 'LVC_FIELDCATALOG_MERGE'
           exporting
                i_structure_name = 'SFLIGHT'
           changing
                ct_fieldcat      = gt_fieldcatalog.
    * change fieldcatalog
      data: ls_fieldcatalog type lvc_s_fcat.
      loop at gt_fieldcatalog into ls_fieldcatalog.
        case ls_fieldcatalog-fieldname.
          when 'CARRID' or 'CONNID' or 'FLDATE'.
            ls_fieldcatalog-no_out = 'X'.
            ls_fieldcatalog-key    = ''.
          when 'PRICE' or 'SEATSOCC' or 'SEATSMAX' or 'PAYMENTSUM'.
            ls_fieldcatalog-do_sum = 'X'.
        endcase.
        modify gt_fieldcatalog from ls_fieldcatalog.
      endloop.
    endform.                               " build_fieldcatalog
    *&      Form  build_hierarchy_header
    *       build hierarchy-header-information
    *      -->P_L_HIERARCHY_HEADER  strucxture for hierarchy-header
    form build_hierarchy_header changing
                                   p_hierarchy_header type treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'.         "#EC NOTEXT
      p_hierarchy_header-tooltip =
                             'This is the Hierarchy Header !'. "#EC NOTEXT
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    endform.                               " build_hierarchy_header
    *&      Form  exit_program
    *       free object and leave program
    form exit_program.
      call method tree1->free.
      leave program.
    endform.                               " exit_program
    *&      Form  build_header
    *       build table for html_header
    *  -->  p1        text
    *  <--  p2        text
    form build_comment using
          pt_list_commentary type slis_t_listheader
          p_logo             type sdydo_value.
      data: ls_line type slis_listheader.
    * LIST HEADING LINE: TYPE H
      clear ls_line.
      ls_line-typ  = 'H'.
    * LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'ALV-tree-demo: flight-overview'.       "#EC NOTEXT
      append ls_line to pt_list_commentary.
    * STATUS LINE: TYPE S
      clear ls_line.
      ls_line-typ  = 'S'.
      ls_line-key  = 'valid until'.                          "#EC NOTEXT
      ls_line-info = 'January 29 1999'.                      "#EC NOTEXT
      append ls_line to pt_list_commentary.
      ls_line-key  = 'time'.
      ls_line-info = '2.00 pm'.                              "#EC NOTEXT
      append ls_line to pt_list_commentary.
    * ACTION LINE: TYPE A
      clear ls_line.
      ls_line-typ  = 'A'.
    * LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'actual data'.                          "#EC NOTEXT
      append ls_line to pt_list_commentary.
      p_logo = 'ENJOYSAP_LOGO'.
    endform.
    *&      Form  create_hierarchy
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form create_hierarchy.
      data: ls_sflight type sflight,
            lt_sflight type sflight occurs 0.
    * get data
      select * from sflight into table lt_sflight
                            UP TO 200 ROWS .
      sort lt_sflight by carrid connid fldate.
    * add data to tree
      data: l_carrid_key type lvc_nkey,
            l_connid_key type lvc_nkey,
            l_last_key type lvc_nkey.
      loop at lt_sflight into ls_sflight.
        on change of ls_sflight-carrid.
          perform add_carrid_line using    ls_sflight
                                  changing l_carrid_key.
        endon.
        on change of ls_sflight-connid.
          perform add_connid_line using    ls_sflight
                                           l_carrid_key
                                  changing l_connid_key.
        endon.
        perform add_complete_line using  ls_sflight
                                         l_connid_key
                                changing l_last_key.
      endloop.
    * calculate totals
      call method tree1->update_calculations.
    * this method must be called to send the data to the frontend
      call method tree1->frontend_update.
    endform.                               " create_hierarchy
    *&      Form  add_carrid_line
    *       add hierarchy-level 1 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    form add_carrid_line using     ps_sflight type sflight
                                   p_relat_key type lvc_nkey
                         changing  p_node_key type lvc_nkey.
      data: l_node_text type lvc_value,
            ls_sflight type sflight.
    * set item-layout
      data: lt_item_layout type lvc_t_layi,
            ls_item_layout type lvc_s_layi.
      ls_item_layout-t_image = '@3P@'.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      append ls_item_layout to lt_item_layout.
    * add node
      l_node_text =  ps_sflight-carrid.
      call method tree1->add_node
        exporting
              i_relat_node_key = p_relat_key
              i_relationship   = cl_gui_column_tree=>relat_last_child
              i_node_text      = l_node_text
              is_outtab_line   = ls_sflight
              it_item_layout   = lt_item_layout
           importing
              e_new_node_key = p_node_key.
    endform.                               " add_carrid_line
    *&      Form  add_connid_line
    *       add hierarchy-level 2 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    form add_connid_line using     ps_sflight type sflight
                                   p_relat_key type lvc_nkey
                         changing  p_node_key type lvc_nkey.
      data: l_node_text type lvc_value,
            ls_sflight type sflight.
    * set item-layout
      data: lt_item_layout type lvc_t_layi,
            ls_item_layout type lvc_s_layi.
      ls_item_layout-t_image = '@3Y@'.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensified.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      append ls_item_layout to lt_item_layout.
    * add node
      l_node_text =  ps_sflight-connid.
      call method tree1->add_node
        exporting
              i_relat_node_key = p_relat_key
              i_relationship   = cl_gui_column_tree=>relat_last_child
              i_node_text      = l_node_text
              is_outtab_line   = ls_sflight
              it_item_layout   = lt_item_layout
           importing
              e_new_node_key = p_node_key.
    endform.                               " add_connid_line
    *&      Form  add_cmplete_line
    *       add hierarchy-level 3 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    form add_complete_line using   ps_sflight type sflight
                                   p_relat_key type lvc_nkey
                         changing  p_node_key type lvc_nkey.
      data: l_node_text type lvc_value.
    * set item-layout
      data: lt_item_layout type lvc_t_layi,
            ls_item_layout type lvc_s_layi.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      ls_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
      ls_item_layout-editable = 'X'.
      append ls_item_layout to lt_item_layout.
      l_node_text =  ps_sflight-fldate.
      call method tree1->add_node
        exporting
              i_relat_node_key = p_relat_key
              i_relationship   = cl_gui_column_tree=>relat_last_child
              is_outtab_line   = ps_sflight
              i_node_text      = l_node_text
              it_item_layout   = lt_item_layout
           importing
              e_new_node_key = p_node_key.
    endform.                               " add_complete_line
    *&      Form  register_events
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form register_events.
    * define the events which will be passed to the backend
      data: lt_events type cntl_simple_events,
            l_event type cntl_simple_event.
    * define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      append L_EVENT to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      append L_EVENT to lt_events.
      call method tree1->set_registered_events
        exporting
          events = lt_events
        exceptions
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      if sy-subrc <> 0.
        message x208(00) with 'ERROR'.                       "#EC NOTEXT
      endif.
    * set Handler
      data: l_event_receiver type ref to lcl_tree_event_receiver.
      create object l_event_receiver.
      set handler l_event_receiver->handle_node_ctmenu_request
                                                            for tree1.
      set handler l_event_receiver->handle_node_ctmenu_selected
                                                            for tree1.
      set handler l_event_receiver->handle_item_ctmenu_request
                                                            for tree1.
      set handler l_event_receiver->handle_item_ctmenu_selected
                                                            for tree1.
    endform.                               " register_events
    *&      Form  change_toolbar
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form change_toolbar.
    * get toolbar control
      call method tree1->get_toolbar_object
              importing
                  er_toolbar = mr_toolbar.
      check not mr_toolbar is initial.
    * add seperator to toolbar
      call method mr_toolbar->add_button
              exporting
                  fcode     = ''
                  icon      = ''
                  butn_type = cntb_btype_sep
                  text      = ''
                  quickinfo = 'This is a Seperator'.         "#EC NOTEXT
    * add Standard Button to toolbar (for Delete Subtree)
      call method mr_toolbar->add_button
              exporting
                  fcode     = 'DELETE'
                  icon      = '@18@'
                  butn_type = cntb_btype_button
                  text      = ''
                  quickinfo = 'Delete subtree'.              "#EC NOTEXT
    * add Dropdown Button to toolbar (for Insert Line)
      call method mr_toolbar->add_button
              exporting
                  fcode     = 'INSERT_LC'
                  icon      = '@17@'
                  butn_type = cntb_btype_dropdown
                  text      = ''
                  quickinfo = 'Insert Line'.           "#EC NOTEXT
    * set event-handler for toolbar-control
      create object toolbar_event_receiver.
      set handler toolbar_event_receiver->on_function_selected
                                                          for mr_toolbar.
      set handler toolbar_event_receiver->on_toolbar_dropdown
                                                          for mr_toolbar.
    endform.                               " change_toolbar
    *&      Form  init_tree
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_tree.
    * create fieldcatalog for structure sflight
      perform build_fieldcatalog.
    * create container for alv-tree
      data: l_tree_container_name(30) type c,
            l_custom_container type ref to cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
      if sy-batch is initial.
        create object l_custom_container
          exporting
                container_name = l_tree_container_name
          exceptions
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
        if sy-subrc <> 0.
          message x208(00) with 'ERROR'.                       "#EC NOTEXT
        endif.
      endif.
    * create tree control
      create object tree1
        exporting
            parent              = l_custom_container
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
            item_selection      = 'X'
            no_html_header      = ''
            no_toolbar          = ''
        exceptions
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
      if sy-subrc <> 0.
        message x208(00) with 'ERROR'.                       "#EC NOTEXT
      endif.
    * create Hierarchy-header
      data l_hierarchy_header type treev_hhdr.
      perform build_hierarchy_header changing l_hierarchy_header.
    * create info-table for html-header
      data: lt_list_commentary type slis_t_listheader,
            l_logo             type sdydo_value.
      perform build_comment using
                     lt_list_commentary
                     l_logo.
    * repid for saving variants
      data: ls_variant type disvariant.
      ls_variant-report = sy-repid.
    * create emty tree-control
      call method tree1->set_table_for_first_display
         exporting
                   is_hierarchy_header  = l_hierarchy_header
                   it_list_commentary   = lt_list_commentary
                   i_logo               = l_logo
                   i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = ls_variant
         changing
                   it_outtab            = gt_sflight "table must be emty !!
                   it_fieldcatalog      = gt_fieldcatalog.
    * create hierarchy
      perform create_hierarchy.
    * add own functioncodes to the toolbar
      perform change_toolbar.
    * register events
      perform register_events.
    * adjust column_width
      call method tree1->COLUMN_OPTIMIZE.
    ENDFORM.                    " init_tree
    regards,
    venu.

  • Macking button to expand the tree and collapse tree and another to add node

    macking button to expand the tree and collapse tree and another to add node and saving the changes in the database ( this is problem)
    and finally delete node from database
    so what is proper code for those buttons
    thanks my mail is :
    [email protected]

    Hello,
    Use the ftree package's functions
    code to expand all nodes:
    PROCEDURE explose_tree IS
    node    ftree.node;
    htree   ITEM;
    state   varchar2(30);
    BEGIN
       -- search the tree ID --
       htree := Find_Item('BL_TREE.TREE_1');
        -- search the root --
           node  := Ftree.Find_Tree_Node(htree, '');
        -- expand all nodes --
       WHILE NOT Ftree.ID_NULL(node) LOOP
          state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
          IF state = Ftree.COLLAPSED_NODE THEN
            Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.EXPANDED_NODE);
          END IF;
          node := Ftree.Find_Tree_Node(htree, '', ftree.find_NEXT,Ftree.NODE_LABEL,'', node);
       END LOOP;
    END;and to collapse all nodes:
    PROCEDURE Implose_tree IS
       node   ftree.node;
       htree  ITEM;
       state  varchar2(30);
    BEGIN
       -- search the root ID --
       htree := Find_Item('BL_TREE.TREE_1'); 
       -- search the root --
       node  := Ftree.Find_Tree_Node(htree, '');  
       -- Collapse all nodes --
       WHILE NOT ftree.ID_NULL(node) LOOP
         state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
         IF state = Ftree.EXPANDED_NODE THEN
          Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.COLLAPSED_NODE);
         END IF;
        node := Ftree.Find_Tree_Node(htree, '', Ftree.FIND_NEXT,Ftree.NODE_LABEL, '', node);
       END LOOP;
    END; Francois

  • FPN Could not load or refresh node Tree creation failed on node: pcd:-Error

    Hi,
    I´m configuring a FPN using CRM Java as a producer and SAP Portal as a consumer, the SSO from SAP Portal to CRM Java is working fine, but we are having this Error when trying to Expand Content Administration > Portal Content > NetWeaver Content Producers > MyProducer System
    Could not load or refresh node Tree creation failed on node: pcd:NetWeaver_content_producers/........
    Also in Identity Management I can see the Federated Data Source but when search for roles no rol is retrieved and returns two messages.
    Last Search might be innacurate
    No element Found
    Has somebody faced this Error?
    Thanx in Advanced!
    Kind Regards,
    Gerardo J

    Hi KRISHNA,
    Check the below thread and notes mentioned in that
    Re: Tree creation failed on node: pcd:portal_content
    Koti Reddy

  • Generate a navigator Tree without Blockname as node

    Hi
    I am generating navigator/hierarchical tree with simple master-detail data.
    I would like only the records to appear in the tree, and not the blockname, as it is really a simple hierarchy with only few records.
    How can I do that?
    Now:
    +DEP
    + Accounting
    + EMP
    Miller
    + Research
    + EMP
    Smith
    Allen
    My goal:
    +DEP (not even necessarily)
    + Accounting
    Miller
    + Research
    Smith
    Allen
    By the way, is there anyway I can make Accounting and Reasearch bold an not Miller and Allen?
    Thanks
    Karine
    PS: I am working with Designer 6i, 6.5.96.5.6
    Edited by: Karine on Feb 24, 2009 1:24 PM

    I got the refreshing of the tree part by myself. One needs to call the refresh method on the GroupingCollection2 and HierarchicalCollectionView objects when the arraycollection has just arrived from the database.
    But I still havent been able to figure out how to highlight or open a tree node programatically. I am repeating that using (calling / setting) tree.expandItem() and tree.openItems is not helping me. Plz somebody help.

Maybe you are looking for

  • File process - some files missing in processing

    Hi, I am using the below code to create drives on network. This exe file is used by ILM as part batch job. The job will pick input files from local drive. Query: While executing this job some input files are missing so for them drive is not created.

  • IPhone Safari block all calls

    iPhone Safari block all calls When i goin to internet in Safari or AppStore at iPhone, people dont colled me.. Internet(1) + phone talk(2) = only (1) or (2)! I buy iphone becose i ned internet and i must every minute talkin by phone, when people call

  • Can't download anything from Ovi store , grayed-ou...

    Hi, I can't download anything from Ovi store anymore , both "download via PC" and "Download on mobile" options are disabled (grayed) This applies to all applications including those which I have never downloaded before !!! I have even created a compl

  • What is the need to combine non qualifiers during IMPORT

    Hi Experts, I want to know the need to combine the non qualifiers during import in the match records field. what is the significance of it? Thanks in advance. Sandhya.

  • Excel Services Refresh Error

    I am passing ID an integer value to Excel-web-access web part in a page. http://server/excel.aspx?ID=100 The value is reaching correctly and displayed on A1 cell of sheet.  But the automatic-refresh is not happening. (I am using the ID cell value to