How to traverse a tree with a search

I have a tree that has many leaves or nodes.
I would like to have a search button where I put in a leaf or node name and it will go to the first occurrence on the tree and a next button that will take me to the next occurrence on the tree.
The table I have looks like this.
table name = PASS_NODE
ID number,
PARENT_ID NUMBER,
NODE_NAME VARCHAR2(20)
the sql code for the tree is:
select "ID" id,
"PARENT_ID" pid,
CASE
WHEN id = :P1_ID
THEN '<span class="t1000url">'
|| node_name
|| ' >>'
|| '</span>'
ELSE node_name
END name,
'f?p=&APP_ID.:1:&SESSION.::NO::P1_ID:'||id LINK,
null a1,
null a2
from "#OWNER#"."PASS_NODE"
order by NODE_NAME
In the search text field the user will put in the NODE_NAME . I would like the search to traverse the tree by NODE NAME .
Any ideas?

I figured this out. In the "Search" process logic it was able to assign the value of the ID to the P1_ID page item.

Similar Messages

  • Traversing a tree with breadthFirstEnumeration

    Hi all,
    I'm trying to traverse a DefaultMutableNode tree using breadthFirstEnumeration. However, while traversing I need to remove some branches and continue with the Enumeration.
    Do you know any way to preserve the Enumeration after removing a branch???
    For example:
    for(Enumeration en = trial.breadthFirstEnumeration(); en.hasMoreElements() ;) {
                   DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode)en.nextElement();
                   if((String)currentNode.getUserObject() == "2") {
                        ((DefaultMutableTreeNode)(currentNode)).removeAllChildren();
                   System.out.println((String)currentNode.getUserObject());
    This code traverses a tree with depth 3 and branching factor 3. In the meanwhile it removes node 2's children.
    However the otuput is
    0 1 2 3 4 5 6
    instead of: 0 1 2 3 4 5 6 10 11 12
    I'd be very grateful if someone can help me.
    Regards,
    Pesho

    This is how it usually is done.
    Start with an empty map, e.g. HashMap. The map has e.g. company name as key, and company as value.
    Start traversing, and do a lookup towards the map when you find a company reference. Use the company within the map if there is one, and create a new company and place it in the map if it doesn't exist. Populate the companies within the map with information when you bump into them during traversal.
    The map will contain fully populated companies when the traversal is completed, and all companies will reference the same instances since you always are checking the map.
    Kaj

  • Advanced:   How to traverse a tree representation in PL/SQL (procedure)?

    I am looking to write a method that will create a collection of records, each of which represents a node in a tree.
    TYPE t_all_folders IS TABLE OF get_all_folders%ROWTYPE INDEX BY PLS_INTEGER;
    v_all_folders t_all_folders;
    so first need help in figuring out what the cursor 'get_all_folders' would look like
    I have a folder structure represented in a database that is used basically to show visually
    (with a front end app) a folder structure (much like a folder structure in a file system).
    So each row has an entry in the 'folders' table like do:
    table folder:
         column           column
         folder_id          name
         1                    folder1               <= say this is a root folder
         2                    folder2               <= say this is a root folder
         3                    folder3               <= say this is a root folder
         4                    folder1a          <= all below are child folders..
         5                    folder1b
         6                    folder1c
         7                    folder1aa
         8                    folder1ab
         There is nothing in this table that indicates a hiearchy.
    The hiearchy is represented by another single table with two columns
    (I cannot change this, it is what it is)
    There is no left node or right node (not like a tree), just imagine sub folders.
    table: parent_child
         column          column
         parent_id     child_id
    such that visually when the tables are queried and the UI uses a folder icon to
    represent each row:
    it would look like this:
         folder1                              1
              - folder1a                         2
                   -folder1aa                    3
                   - folder1ab                    4
              - folder1b                         5
                   - folder1ba                    6
                   - folder1bb                    7
              - folder1c                         8
         folder2                              9
         folder3                              10
    I am attempting to create a query that will add to a collection folder records in the
    order above (1..10)
    In other words traverse the tree depth first going from:
              folder1 -> folder1a -> folder1aa -> folder1ab ->(back out to next level) folder1b -> folder1ba -> folder1bb -> folder1c
              then add folder2 (and traverse down that hiearch if needed)
              and then add folder3 to the colleciton and traverse down that hiearchy if there is one
              and continue adn so on.
              The requirement is to have them added to the collection in that order and when I iterate through the collection,
              they would of course need to be pulled out in that order (so use vararray with a counter to iterate through
              after the collection has been created.
    After the collection has been created, I have to iterate in that specific order to create records in another table where there is a column that requires an integer value that is the 1... order they come out of the collection
    and then have to iterate again and do something else in that order (and then other things - all the while needing in that order).
    Edited by: user12200443 on Nov 19, 2012 11:49 AM

    awesome, thanks for the help.
    put this in 'schema.sql' and run to create a reference schema and data for the example
    drop sequence seq_folders;
    CREATE SEQUENCE seq_folders
    INCREMENT BY 1
    MINVALUE 1
    START WITH 1
    CACHE 1000;
    drop table folders;
    create table folders (
         folder_id number not null,
         name varchar2(20) not null
    drop table parent_child;
    create table parent_child (
         parent_id number not null,
         child_id number not null);
    -- creation order (in order to have parent)
    -- folder1
    -- folder2
    -- folder3
    -- folder1a
    -- folder1b
    -- folder1c
    -- folder1aa
    -- folder1ab
    -- folder1ac
    -- folder1aaa
    -- folder1aba
    -- folder1aab
    -- folder1abb
    -- folder1aac
    -- folder1abc
    -- Visual hiearchy
    -- folder1                              1
    --      folder1a                         2
    --           folder1aa               3
    --                folder1aaa          4
    --                folder1aab          5
    --                folder1aac          6
    --           folder1ab               7
    --                folder1aba          8
    --                folder1abb          9
    --           folder1ac               10
    --      folder1b                         11
    --      folder1c                         12
    -- folder2                              13
    -- folder3                              14
    --- insert folders
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder2');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder3');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1a');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1b');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1c');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1aa');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1ab');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1ac');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1aaa');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1aba');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1aab');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1abb');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1aac');
    insert into folders(folder_id, name) values(seq_folders.nextval, 'folder1abc');
    commit;
    -- setup hiearchy
    insert into parent_child(parent_id, child_id) values (0, (select folder_id from folders where name = 'folder1'));
    insert into parent_child(parent_id, child_id) values (0, (select folder_id from folders where name = 'folder2'));
    insert into parent_child(parent_id, child_id) values (0, (select folder_id from folders where name = 'folder3'));
    -- 1a,1b,1c
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1'), (select folder_id from folders where name = 'folder1a'));
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1'), (select folder_id from folders where name = 'folder1b'));
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1'), (select folder_id from folders where name = 'folder1c'));
    -- aa,ab,ac
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1a'), (select folder_id from folders where name = 'folder1aa'));
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1a'), (select folder_id from folders where name = 'folder1ab'));
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1a'), (select folder_id from folders where name = 'folder1ac'));
    -- aaa,aba,aab
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1aa'), (select folder_id from folders where name = 'folder1aaa'));
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1aa'), (select folder_id from folders where name = 'folder1aab'));
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1aa'), (select folder_id from folders where name = 'folder1aac'));
    -- aba,abb,abc
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1ab'), (select folder_id from folders where name = 'folder1aba'));
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1ab'), (select folder_id from folders where name = 'folder1abb'));
    insert into parent_child(parent_id, child_id) values ((select folder_id from folders where name ='folder1ab'), (select folder_id from folders where name = 'folder1abc'));
    commit;
    then run this to get the error message
    WITH joined_data     AS
         SELECT     f.folder_id,     f.name,     pc.parent_id
         FROM     folders     f
         JOIN     parent_child     pc ON pc.child_id = f.folder_id
    SELECT     j.*,     ROWNUM     
    AS r_num
    FROM joined_data     j
    START WITH     parent_id =0
    CONNECT BY     parent_id= PRIOR child_id
    ORDER SIBLINGS BY     name;
    thanks for the help, hopefully I can find a way to read the rows/record into a data structure (does not have to be a single sql statement - can be anything I can do in PL/SQL.
    Edited by: user12200443 on Nov 19, 2012 5:55 PM

  • How to traverse an array with a for-loop in this certain way...

    so I need to traverse an array starting from the first element, then from the last element, then the second element, then the second last element, then third element and so on... in a for loop
    how would that look in code?
    Any help would be appreciated, thanks!
    Edited by: inspiredone on Apr 4, 2008 6:34 AM

    Wow, that's a really clever and elegant way to do it promethuzz. I actually came up with something already before I read your post so yeah don't worry about me copying or anything. Mine is not as elegant/efficient and I definitely like yours a lot more but I will just share it anyway...it looks pretty similar to the second algorithm The_Matrix has provided. I figured this out from thinking how quicksort compares its pivot with the two indexes...
        int front=0;
        int back = a.length - 1;
        int counter =0;
        boolean switchflag = true;
        while(front<=back)
          System.out.println(a[counter]);
          if(switchflag)
            counter = back;
            front++;
            switchflag = false;
          else
            counter = front;
            back--;
            switchflag = true;
        } Anyways, thanks a lot for you guys help, promethuzz, The_Matrix, and newark.
    Edited by: inspiredone on Apr 4, 2008 11:25 AM
    Edited by: inspiredone on Apr 4, 2008 11:27 AM

  • How to load my tree with data from SQL database????

    Hello friends
    May i know how i can load my tree with my database??
    i have 3 different tables and i need them to be the 3 main nodes of my tree
    They are
    1.fiche
    2.amis and
    3.famille
    and in each of these nodes need to load the 3 databases
    thank u in advance

    Heres my program so i loaded my vector ,
    Now how can i integrate the coding u gave me, and where ??
    Is it where i put the quetion mark?
    if so
    can you tell me how?? because i didnt understood well the codings you gave me as im nt at all familiar with this
    Thank you in advance
    public class carnetf extends javax.swing.JFrame  {
       DefaultMutableTreeNode root =null;
        public carnetf() {
           root= new DefaultMutableTreeNode("Carnet");
            DefaultMutableTreeNode tnFiche=new DefaultMutableTreeNode("Fiche");
           root.add( tnFiche);
            DefaultMutableTreeNode tnAmis=new DefaultMutableTreeNode("Amis");
            root.add( tnAmis);
            DefaultMutableTreeNode tnFamille=new DefaultMutableTreeNode("Famille");
            root.add( tnFamille);
           initComponents();
        public Vector vecfiche() {
            Vector v = new Vector();    
            Connection connection = null;
            try
                Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());;
            catch (Exception E)
                System.out.println("Unable to load driver.");
                System.out.println(E.getMessage());
                E.printStackTrace();
                return null;
            try
                connection = DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;user=sa;password=sa;DatabaseName=carnet");
            catch (Exception E)
                System.out.println("Unable to connect.");
                System.out.println(E.getMessage());
                return null;
            try
                Statement Stmt = connection.createStatement();
                if(jRadioButton1.isSelected()==true)  
                    String Query = "SELECT * FROM fiche";
                ResultSet RS= Stmt.executeQuery( Query );
                while ( RS.next())
                 v.add( new vecfiche( RS.getString("Nom"), RS.getString("Prenom")));
                if( RS!= null) RS.close();}
                if(jRadioButton2.isSelected()==true)  
                    String Query = "SELECT * FROM amis";
                ResultSet RS= Stmt.executeQuery( Query );
                while ( RS.next())
                 v.add( new vecfiche( RS.getString("Anom"), RS.getString("Aprenom")));
                if( RS!= null) RS.close();}
                if(jRadioButton3.isSelected()==true)  
                    String Query = "SELECT * FROM famille";
                ResultSet RS= Stmt.executeQuery( Query );
                while ( RS.next())
                 v.add( new vecfiche( RS.getString("Fnom"), RS.getString("Fprenom")));
                if( RS!= null) RS.close();}
                if( Stmt!= null) Stmt.close();
            catch (Exception E)
                System.out.println("Unable to query.");
                System.out.println(E.getMessage());
                return null;
            try
                connection.close();
            } catch (Exception E)
                System.out.println("Unable to close.");
                System.out.println(E.getMessage());
                return null;
            return v;
        }

  • How to construct a tree with 2 or other trees

    Hi,
    I want to create one tree with 2 trees like :
    - first tree :
    a
    b--c
    - second tree :
    a
    b
    d
    e
    f--i--j
    - the result is :
    a
    b--c
    d
    e
    f--i--j
    The first and second tree have the same frame (root). I create one tree when I select one node or one leaf on a tree and put in on a table.
    Now with this trees I want to create one tree (fuse trees in the table).
    If anyone have a solution.
    Thanks.

    See this example of merge.
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.text.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    class Demo {
    private JFrame frame;
    JScrollPane scroll1;
    JScrollPane scroll2;
    JTree tree1;
    JTree tree2;
    public Demo() throws Exception {
    frame=new JFrame();
    frame.getContentPane().setLayout(new BorderLayout());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel p=new JPanel(new GridLayout(1,2));
    DefaultMutableTreeNode node,node1;
    DefaultMutableTreeNode root1=new DefaultMutableTreeNode("root");
    node=new DefaultMutableTreeNode("1");
    root1.add(node);
    node1=new DefaultMutableTreeNode("11");
    node.add(node1);
    node1=new DefaultMutableTreeNode("12");
    node.add(node1);
    node=new DefaultMutableTreeNode("2");
    node1=new DefaultMutableTreeNode("21");
    node.add(node1);
    root1.add(node);
    DefaultTreeModel m=new DefaultTreeModel(root1);
    tree1=new JTree(m);
    scroll1=new JScrollPane(tree1);
    p.add(scroll1);
    DefaultMutableTreeNode root2=new DefaultMutableTreeNode("root");
    node=new DefaultMutableTreeNode("1");
    root2.add(node);
    node1=new DefaultMutableTreeNode("11");
    node.add(node1);
    node1=new DefaultMutableTreeNode("13");
    node.add(node1);
    node=new DefaultMutableTreeNode("3");
    node1=new DefaultMutableTreeNode("31");
    node.add(node1);
    root2.add(node);
    m=new DefaultTreeModel(root2);
    tree2=new JTree(m);
    scroll2=new JScrollPane(tree2);
    p.add(scroll2);
    frame.getContentPane().add(p,BorderLayout.CENTER);
    JButton b=new JButton("merge");
    ActionListener lst=new ActionListener() {
    public void actionPerformed (ActionEvent e) {
    merge(tree1,tree2);
    ((DefaultTreeModel)tree1.getModel()).reload();
    ((DefaultTreeModel)tree2.getModel()).reload();
    b.addActionListener(lst);
    frame.getContentPane().add(b,BorderLayout.SOUTH);
    frame.pack();
    frame.show();
    public void merge(JTree firstTree,JTree secondTree) {
    DefaultMutableTreeNode root1=(DefaultMutableTreeNode)((DefaultTreeModel)firstTree.getModel()).getRoot();
    DefaultMutableTreeNode root2=(DefaultMutableTreeNode)((DefaultTreeModel)secondTree.getModel()).getRoot();
    mergeNodes(root2,root1);
    private void mergeNodes(DefaultMutableTreeNode source
    ,DefaultMutableTreeNode dest) {
    int cnt=source.getChildCount();
    for (int i=0; i<cnt; i++) {
    DefaultMutableTreeNode child=(DefaultMutableTreeNode)source.getChildAt(i);
    int ind=isContained(dest,child);
    if (ind==-1) {
    dest.add(child);
    else {
    mergeNodes(child,(DefaultMutableTreeNode)dest.getChildAt(ind));
    private int isContained(DefaultMutableTreeNode parent, DefaultMutableTreeNode child) {
    int result=-1;
    int cnt=parent.getChildCount();
    for (int i=0; i<cnt; i++) {
    if (((DefaultMutableTreeNode)parent.getChildAt(i)).getUserObject().equals(child.getUserObject())) {
    return i;
    return result;
    public static void main(String[] argv)
    throws Exception
    Demo html = new Demo();
    regards
    Stas

  • How to replace LOV popup with a search screen that opens within same window

    Hi,
    We have a requirement to get rid of LOV popups from our custom OA pages. They need to be replaced by search pages that open within the same window.
    For example, we are creating an employee assignment to a department. We first find the employee (currently using the LOV), then the department (currently using another LOV) and then save the new assignmnet record.
    The two options we have are:
    1. search page fully replaces the current page, and when the user has selected a record, it returns them back to the first page, setting some fields, eg. employee id, employee name, employee address fields.
    2. search page opens in a region of the same page (PPR?) and then disappears once the user has seleted a record.
    I am not sure how to do this, and really could do with some pointers, i.e. the best way to achieve this.
    Thanks in advance
    Mark

    Both of your options are valid with some pros and cons.
    option 1: It gives you a nice interface but then you will have a pass a large number of data back to 1st page.
    options 2: You can use the Rendered property of a serach region at runtime and achieve your goal. Since it will be a single page, result set to base items mapping will be easier. Though this kind of UI will look bad if your search region is big.
    So it all depends on which option is easier to implement for you.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to traverse the tree in reverse direction?

    How do I roll up numbers up a tree? Suppose I have the following tree (diagram #1). Each node is designated with an ID number,
    representing a primay key in a table. Only leaf nodes have a number (preceded by the @ sign) associated with it (see
    diagram #1). How do I write an efficient SQL that will add up numbers from the leaf nodes and roll up the numbers
    up the entire tree all the way to the root node so the final tree looks like that depicted in diagram #2?
    Diagram #1
                                (1)
                                 |
                                 |
                       |         |            |
                       |         |            |
                      (2)       (3)          (4)@10
                       |          |
                       |           |
                  -------           |
                  |     |           |
                  |     |             |
                 (5)   (6)@20   (7)(@null)
                  |
                  |
                 (8)@30
    Diagram #2
                                (1)@60
                                 |
                                 |
                       |         |            |
                       |         |            |
                      (2)@50    (3)@0        (4)@10
                       |         |(if null)
                       |             |
               ----------             |
               |        |              |
               |        |               |
              (5)@30   (6)@20   (7)(@null)
               |
               |
              (8)@30DB version is 10.2 and OS is Windows server 2008
    create table ad_treenode
    (ad_client_id number(10),
    ad_org_id number(10),
    node_id number(10), --PK
    parent_id number(10)
    INSERT INTO ad_treenode VALUES (11,11,709,704);
    INSERT INTO ad_treenode VALUES (11,11,710,709);
    INSERT INTO ad_treenode VALUES (1000000,0,1000001,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000002,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000003,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000004,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000005,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000006,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000070,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000071,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000072,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000073,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000074,1000099);
    INSERT INTO ad_treenode VALUES (1000000,0,1000075,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000076,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000077,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000078,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000079,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000080,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000081,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000082,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000083,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000084,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000085,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000086,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000087,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000088,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000089,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000090,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000091,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000092,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000093,1000076);
    INSERT INTO ad_treenode VALUES (1000000,0,1000094,1000071);
    INSERT INTO ad_treenode VALUES (1000000,0,1000095,1000071);
    INSERT INTO ad_treenode VALUES (1000000,0,1000096,1000071);
    INSERT INTO ad_treenode VALUES (1000000,0,1000097,1000071);
    INSERT INTO ad_treenode VALUES (1000000,0,1000098,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000099,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000100,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000101,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000102,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000103,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000104,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000105,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000106,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000107,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000108,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000109,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000110,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000111,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000112,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000113,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000114,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000115,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000116,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000117,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000118,1000072);
    INSERT INTO ad_treenode VALUES (1000000,0,1000119,1000072);
    INSERT INTO ad_treenode VALUES (1000000,0,1000120,1000077);
    INSERT INTO ad_treenode VALUES (1000000,0,1000000,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000001,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000002,1000090);
    INSERT INTO ad_treenode VALUES (1000000,0,1000003,1000093);
    INSERT INTO ad_treenode VALUES (1000000,0,1000004,1000372);
    INSERT INTO ad_treenode VALUES (1000000,0,1000005,1000093);
    INSERT INTO ad_treenode VALUES (1000000,0,1000006,1000141);
    INSERT INTO ad_treenode VALUES (1000000,0,1000007,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000008,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000009,1000168);
    INSERT INTO ad_treenode VALUES (1000000,0,1000010,1000122);
    INSERT INTO ad_treenode VALUES (1000000,0,1000011,1000168);
    INSERT INTO ad_treenode VALUES (1000000,0,1000012,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000013,1000119);
    INSERT INTO ad_treenode VALUES (1000000,0,1000014,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000015,1000093);
    INSERT INTO ad_treenode VALUES (1000000,0,1000016,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000017,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000018,1000092);
    INSERT INTO ad_treenode VALUES (1000000,0,1000019,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000020,1000090);
    INSERT INTO ad_treenode VALUES (1000000,0,1000021,1000141);
    INSERT INTO ad_treenode VALUES (1000000,0,1000022,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000023,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000024,1000092);
    INSERT INTO ad_treenode VALUES (1000000,0,1000025,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000026,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000027,1000077);
    INSERT INTO ad_treenode VALUES (1000000,0,1000028,1000116);
    INSERT INTO ad_treenode VALUES (1000000,0,1000029,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000030,1000090);
    INSERT INTO ad_treenode VALUES (1000000,0,1000031,1000139);
    INSERT INTO ad_treenode VALUES (1000000,0,1000032,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000033,1000091);
    INSERT INTO ad_treenode VALUES (1000000,0,1000034,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000035,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000036,1000093);
    INSERT INTO ad_treenode VALUES (1000000,0,1000037,1000229);
    INSERT INTO ad_treenode VALUES (1000000,0,1000038,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000039,1000192);
    INSERT INTO ad_treenode VALUES (1000000,0,1000040,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000041,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000042,1000192);
    INSERT INTO ad_treenode VALUES (1000000,0,1000043,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000044,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000045,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000046,1000091);
    INSERT INTO ad_treenode VALUES (1000000,0,1000047,1000083);
    INSERT INTO ad_treenode VALUES (1000000,0,1000048,1000139);
    INSERT INTO ad_treenode VALUES (1000000,0,1000049,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000050,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000051,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000052,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000053,1000122);
    INSERT INTO ad_treenode VALUES (1000000,0,1000054,1000091);
    INSERT INTO ad_treenode VALUES (1000000,0,1000055,1000229);
    INSERT INTO ad_treenode VALUES (1000000,0,1000056,1000116);
    INSERT INTO ad_treenode VALUES (1000000,0,1000057,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000058,1000079);
    INSERT INTO ad_treenode VALUES (1000000,0,1000059,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000060,1000106);
    INSERT INTO ad_treenode VALUES (1000000,0,1000061,1000083);
    INSERT INTO ad_treenode VALUES (1000000,0,1000062,1000076);
    INSERT INTO ad_treenode VALUES (1000000,0,1000063,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000064,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000065,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000066,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000067,1000112);
    INSERT INTO ad_treenode VALUES (1000000,0,1000068,1000108);
    INSERT INTO ad_treenode VALUES (1000000,0,1000069,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000121,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000122,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000123,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000124,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000125,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000126,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000127,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000128,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000129,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000130,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000131,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000132,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000133,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000134,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000135,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000136,1000135);
    INSERT INTO ad_treenode VALUES (1000000,0,1000137,1000135);
    INSERT INTO ad_treenode VALUES (1000000,0,1000138,1000135);
    INSERT INTO ad_treenode VALUES (1000000,0,1000139,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000141,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000142,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000143,1000082);
    INSERT INTO ad_treenode VALUES (1000000,0,1000144,1000082);
    INSERT INTO ad_treenode VALUES (1000000,0,1000145,1000082);
    INSERT INTO ad_treenode VALUES (1000000,0,1000146,1000150);
    INSERT INTO ad_treenode VALUES (1000000,0,1000147,1000150);
    INSERT INTO ad_treenode VALUES (1000000,0,1000148,1000150);
    INSERT INTO ad_treenode VALUES (1000000,0,1000149,1000150);
    INSERT INTO ad_treenode VALUES (1000000,0,1000150,1000084);
    INSERT INTO ad_treenode VALUES (1000000,0,1000151,1000084);
    INSERT INTO ad_treenode VALUES (1000000,0,1000152,1000151);
    INSERT INTO ad_treenode VALUES (1000000,0,1000153,1000151);
    INSERT INTO ad_treenode VALUES (1000000,0,1000154,1000151);
    INSERT INTO ad_treenode VALUES (1000000,0,1000155,1000084);
    INSERT INTO ad_treenode VALUES (1000000,0,1000156,1000155);
    INSERT INTO ad_treenode VALUES (1000000,0,1000157,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000158,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000159,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000160,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000161,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000162,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000163,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000164,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000165,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000166,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000167,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000168,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000169,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000170,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000171,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000172,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000173,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000174,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000175,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000176,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000177,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000178,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000179,1000088);
    INSERT INTO ad_treenode VALUES (1000000,0,1000180,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000181,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000182,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000183,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000184,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000185,1000088);
    INSERT INTO ad_treenode VALUES (1000000,0,1000186,1000088);
    INSERT INTO ad_treenode VALUES (1000000,0,1000187,1000229);
    INSERT INTO ad_treenode VALUES (1000000,0,1000188,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000189,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000190,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000191,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000192,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000193,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000194,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000195,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000196,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000197,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000198,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000199,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000201,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000202,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000203,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000204,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000205,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000207,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000208,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000209,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000210,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000211,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000212,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000213,1000096);
    INSERT INTO ad_treenode VALUES (1000000,0,1000214,1000096);
    INSERT INTO ad_treenode VALUES (1000000,0,1000215,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000216,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000217,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000218,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000219,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000220,1000118);
    INSERT INTO ad_treenode VALUES (1000000,0,1000221,1000118);
    INSERT INTO ad_treenode VALUES (1000000,0,1000222,1000118);
    INSERT INTO ad_treenode VALUES (1000000,0,1000223,1000118);
    INSERT INTO ad_treenode VALUES (1000000,0,1000225,1000119);
    INSERT INTO ad_treenode VALUES (1000000,0,1000226,1000119);
    INSERT INTO ad_treenode VALUES (1000000,0,1000229,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000230,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000231,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000232,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000233,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000234,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000235,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000236,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000237,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000238,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000239,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000240,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000241,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000242,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000243,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000244,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000245,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000247,1000122);
    INSERT INTO ad_treenode VALUES (1000000,0,1000248,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000249,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000250,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000251,1000089);
    INSERT INTO ad_treenode VALUES (1000000,0,1000252,1000089);
    INSERT INTO ad_treenode VALUES (1000000,0,1000253,1000090);
    INSERT INTO ad_treenode VALUES (1000000,0,1000254,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000255,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000256,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000257,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000258,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000259,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000260,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000261,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000262,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000263,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000264,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000265,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000266,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000267,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000268,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000269,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000270,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000271,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000272,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000273,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000274,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000275,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000276,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000277,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000278,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000279,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000280,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000281,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000282,1000099);
    INSERT INTO ad_treenode VALUES (1000000,0,1000283,1000099);
    INSERT INTO ad_treenode VALUES (1000000,0,1000284,1000099);
    INSERT INTO ad_treenode VALUES (1000000,0,1000285,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000286,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000287,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000288,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000289,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000290,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000291,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000292,1000101);
    INSERT INTO ad_treenode VALUES (1000000,0,1000293,1000101);
    INSERT INTO ad_treenode VALUES (1000000,0,1000294,1000101);
    INSERT INTO ad_treenode VALUES (1000000,0,1000295,1000102);
    INSERT INTO ad_treenode VALUES (1000000,0,1000296,1000102);
    INSERT INTO ad_treenode VALUES (1000000,0,1000297,1000102);
    INSERT INTO ad_treenode VALUES (1000000,0,1000298,1000102);
    INSERT INTO ad_treenode VALUES (1000000,0,1000299,1000103);
    INSERT INTO ad_treenode VALUES (1000000,0,1000300,1000103);
    INSERT INTO ad_treenode VALUES (1000000,0,1000301,1000104);
    INSERT INTO ad_treenode VALUES (1000000,0,1000302,1000104);
    INSERT INTO ad_treenode VALUES (1000000,0,1000303,1000104);
    INSERT INTO ad_treenode VALUES (1000000,0,1000304,1000104);
    INSERT INTO ad_treenode VALUES (1000000,0,1000305,1000105);
    INSERT INTO ad_treenode VALUES (1000000,0,1000306,1000105);
    INSERT INTO ad_treenode VALUES (1000000,0,1000307,1000105);
    INSERT INTO ad_treenode VALUES (1000000,0,1000308,1000105);
    create table c_elementvalue
    (ad_client_id number(10),
    ad_org_id number(10),
    c_elementvalue_id number(10), --PK     and   ad_treenode.node_id = c_elementvalue.c_elementvalue_id
    name varchar(100)
    INSERT INTO c_elementvalue VALUES (1000000,0,1000070, 'Assets');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000073, 'Sales');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000074, 'Cost of Goods Sold');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000075, 'Expenses');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000076, 'Other Income');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000077, 'Other Expenses');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000078, 'Costing');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000079, 'Commitment Accounting');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000080, 'Cash');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000081, 'Account Receivable');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000082, 'Investments');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000083, 'Inventory');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000085, 'Land And Building');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000087, 'Accumulated Depriciation');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000088, 'Other Assets');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000089, 'Returns');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000090, 'Inventry CoGs');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000091, 'CoGs Variances');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000092, 'CoGs Discounts');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000093, 'Currency gain');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000094, 'Account Payables');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000095, 'Accrued Expenses');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000096, 'Current Note Payables');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000097, 'Long Term liabilities');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000098, 'Payroll Expenses');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000099, 'Occupancy Cost');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000384, 'Late Fee Charge Revenue');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000385, 'Cash Transfer to Tower');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000386, 'Cash Transfer From B.Ed College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000387, 'Cash Transfer from BHM College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000388, 'Cash Transfer from Engg College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000389, 'Cash Transfer from MBA College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000390, 'Cash Transfer from Polytechnic College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000391, 'Cash Transfer from School');
    create table t_trialbalance
    (ad_client_id number(10),
    ad_org_id number(10),
    account_id number(10), --PK   and   t_trialbalance.account_id = t_trialbalance.t_trialbalance_id   or   ad_tree.node_id  =   t_trialbalance.account_id
    amtsourcecr number(10),
    amtsourcedr number(10)
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 21000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 21000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 15900);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 15200);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 10500);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 18500);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 40400);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000008, 100500 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000012, 34550 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 34550);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000023, 1000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 1000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 20000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 20000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 20000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 20000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000012, 6400 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 6400);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 39695);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 39695 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 1160);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000008, 1160 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 580);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 48);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000008, 628 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000023, 1000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 1000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 23.34);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000023, 1000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 1000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 63650);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 63650 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 63650);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 63650 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 35795);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 35795 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 51900);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 51900 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 51900);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 51900 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 35795);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 35795 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 13700);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 8120);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 13700);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 36200);
    I had two sql's but not upto mark
    SELECT LPAD(' ', 2*level-1)||SYS_CONNECT_BY_PATH(node_id, '/') "Path"
          FROM ad_treenode
          START WITH parent_id = 0
          CONNECT BY PRIOR node_id = parent_id;
    select ad_client_id, ad_org_id, rpad('*',2*level,'*') || node_id , parent_id,
             (select sum(amtsourcecr)
                    from t_trialbalance t2
                       start with t2.account_id = t1.node_id
                       connect by prior node_id = parent_id) amtsourcecr,
             (select name from c_elementvalue where c_elementvalue_id=t1.node_id) name
    from ad_treenode t1
    start with parent_id = 0
    connect by prior node_id = parent_id;The o/p i want according to diagram-2 is
    node_id    node_name(from c_elementvalue)      amtsourcecr(from t_trialbalance)
    1                     aaa                                            60
    2                     bbb                                            50
    3                     ccc                                               0
    4                     ddd                                            10
    5                     eee                                            30
    6                     fff                                               20
    7                     ggg                                             null
    8                      hhh                                            30Edited by: Navneet Singh on Mar 6, 2012 4:02 PM
    Edited by: Navneet Singh on Mar 6, 2012 4:03 PM

    I tried according the upper suggestions. The below query is too slow that i made. It takes 10 minutes to fetch the result. I think the data is too much thats y. Is there any other method that it can fetches out the result with in 1-2 minutes.
    SELECT     e.ad_client_id, e.ad_org_id,
                  LPAD (' ', LEVEL * 2) || e.NAME AS NAME, e.node_id, e.parent_id,
                  amtcr,
                  NVL ((SELECT     SUM (amtcr)
                              FROM (SELECT   a.ad_client_id, a.ad_org_id,
                                             a.node_id, a.parent_id,
                                             SUM (b.amtsourcecr) AS amtcr,
                                             SUM (b.amtsourcedr) AS amtdr, c.NAME,
                                             b.c_acctschema_id, b.c_period_id,
                                             b.dateacct, b.account_id,
                                             b.accountvalue, b.postingtype,
                                             b.ad_pinstance_id
                                        FROM ad_treenode a LEFT OUTER JOIN t_trialbalance b
                                             ON b.account_id = a.node_id
                                             LEFT OUTER JOIN c_elementvalue c
                                             ON c.c_elementvalue_id = a.node_id
                                    GROUP BY a.ad_client_id,
                                             a.ad_org_id,
                                             a.node_id,
                                             a.parent_id,
                                             NAME,
                                             b.c_acctschema_id,
                                             b.c_period_id,
                                             b.dateacct,
                                             b.account_id,
                                             b.accountvalue,
                                             b.postingtype,
                                             b.ad_pinstance_id) e2
                              WHERE e2.ad_pinstance_id = e.ad_pinstance_id
                               AND e2.dateacct = e.dateacct
                               AND e2.postingtype = e.postingtype
                               AND e2.c_acctschema_id = e.c_acctschema_id
                               AND e2.ad_org_id = e.ad_org_id
                               AND e2.ad_client_id = e.ad_client_id
                        START WITH e2.node_id = e.node_id
                        CONNECT BY e2.parent_id = PRIOR e2.node_id),
                       0
                      ) amt_cr2,
                  amtdr,
                  NVL ((SELECT     SUM (amtdr)
                              FROM (SELECT   a.ad_client_id, a.ad_org_id,
                                             a.node_id, a.parent_id,
                                             SUM (b.amtsourcecr) AS amtcr,
                                             SUM (b.amtsourcedr) AS amtdr, c.NAME,
                                             b.c_acctschema_id, b.c_period_id,
                                             b.dateacct, b.account_id,
                                             b.accountvalue, b.postingtype,
                                             b.ad_pinstance_id
                                        FROM ad_treenode a LEFT OUTER JOIN t_trialbalance b
                                             ON b.account_id = a.node_id
                                             LEFT OUTER JOIN c_elementvalue c
                                             ON c.c_elementvalue_id = a.node_id
                                    GROUP BY a.ad_client_id,
                                             a.ad_org_id,
                                             a.node_id,
                                             a.parent_id,
                                             NAME,
                                             b.c_acctschema_id,
                                             b.c_period_id,
                                             b.dateacct,
                                             b.account_id,
                                             b.accountvalue,
                                             b.postingtype,
                                             b.ad_pinstance_id) e2
                              WHERE e2.ad_pinstance_id = e.ad_pinstance_id
                               AND e2.dateacct = e.dateacct
                               AND e2.postingtype = e.postingtype
                               AND e2.c_acctschema_id = e.c_acctschema_id
                               AND e2.ad_org_id = e.ad_org_id
                               AND e2.ad_client_id = e.ad_client_id
                         START WITH e2.node_id = e.node_id
                        CONNECT BY e2.parent_id = PRIOR e2.node_id),
                       0
                      ) amt_dr2,
                  e.c_acctschema_id, e.c_period_id, e.dateacct, e.account_id,
                  e.accountvalue, e.postingtype, e.ad_pinstance_id
             FROM (SELECT   a.ad_client_id, b.ad_org_id, a.node_id, a.parent_id,
                            SUM (b.amtsourcecr) AS amtcr,
                            SUM (b.amtsourcedr) AS amtdr, c.NAME,
                            b.c_acctschema_id, b.c_period_id, b.dateacct,
                            b.account_id, b.accountvalue, b.postingtype,
                            b.ad_pinstance_id
                       FROM ad_treenode a LEFT OUTER JOIN t_trialbalance b
                            ON b.account_id = a.node_id
                            LEFT OUTER JOIN c_elementvalue c
                            ON c.c_elementvalue_id = a.node_id
                   GROUP BY a.ad_client_id,
                            b.ad_org_id,
                            a.node_id,
                            a.parent_id,
                            NAME,
                            b.c_acctschema_id,
                            b.c_period_id,
                            b.dateacct,
                            b.account_id,
                            b.accountvalue,
                            b.postingtype,
                            b.ad_pinstance_id) e
        where e.ad_org_id=1000002
       START WITH e.parent_id = 0
       CONNECT BY e.parent_id = PRIOR e.node_id
         ORDER SIBLINGS BY e.NAME;
    SQL> select count(*) from t_trialbalance;
      COUNT(*)
        108384
    SQL> select count(*) from ad_treenode;
      COUNT(*)
          1366
    SQL> select count(*) from c_elementvalue;
      COUNT(*)
           971Is there any way to get out this hangout?

  • How to make a tree with more information in one line

    Hi
    I have seached this forum, and haven't find any information that I can use.
    I need a tree structure with following informations:
    arbpl
    _____aufnr________material_____ text
    _______extra informations
      |_____aufnr________material_____ text
      ....................................................... |_______extra informations
    My problem is that I can't get more than one information each line.
    Can anybody give me some input, and better good advice/examples hot to do.
    My code looks like this:
    *& Report  my report
    REPORT  myreport.
    type-pools : stree.
    data : wa_node type snodetext.
    data : node_table like wa_node occurs 0 with header line.
    TABLES: caufv, caufvd, IOOPER, marc, mara, resb, jest, tj02t.
    data: BEGIN OF gt_status_tab occurs 0,
          aufnr like caufv-aufnr,
          stat like jest-stat,
          txt04 like tj02t-txt04,
          end of gt_status_tab.
    data: g_objnr like jest-objnr.
    data: BEGIN OF gt_sele_tab OCCURS 0,
          werks like caufv-werks,
          fevor like marc-fevor,
          arbpl like IOOPER-arbpl,
          aufnr like caufv-aufnr,
          aufplA like caufv-aufpl,
          matnr like caufvd-matnr,
          gstrp like CAUFV-GSTRP,
          GLTRP LIKE CAUFV-GLTRP,
          rmatnr like resb-matnr,
          bdmng like resb-bdmng,
          GAMNG like caufv-GAMNG,
          aufpl like resb-aufpl,
          auart like caufv-auart,
          matkl like mara-matkl,
          istat like tj02t-istat,
         inact  like jest-inact,
    END OF gt_sele_tab.
    select-options:
    s_werks for CAUFV-werks,
    s_arbpl for iooper-arbpl,
    s_fevor for marc-fevor,
    s_aufnr for caufv-aufnr,
    s_sttxt for CAUFVD-STTXT,
    s_auart for caufv-auart,
    s_matnr for caufvd-matnr,
    s_matkl for mara-matkl,
    s_rmatnr for resb-matnr,
    s_gstrp for caufv-gstrp,
    s_gltrp for caufv-gltrp.
    start-of-SELECTION.
      SELECT  a~werks
              a~fevor
              a~aufnr
              a~PLNBEZ
              a~gstrp
              a~gltrp
              a~aufpl
              b~matnr
              b~bdmng
              a~gamng
              b~aufpl
              a~auart
              d~matkl
        into "CORRESPONDING FIELDS OF TABLE gt_sele_tab
        (gt_sele_tab-werks,
        gt_sele_tab-fevor,
        gt_sele_tab-aufnr,
         gt_sele_tab-matnr,
         gt_sele_tab-gstrp,
         gt_sele_tab-gltrp,
         gt_sele_tab-aufplA,
        gt_sele_tab-rmatnr,
        gt_sele_tab-bdmng,
        gt_sele_tab-GAMNG,
        gt_sele_tab-aufpl,
        gt_sele_tab-auart,
        gt_sele_tab-matkl)
         FROM  CAUFV as a
        join resb as b
        on b~rsnum = a~rsnum
        and b~rspos = b~rspos
        join afvc as C
        on c~aufpl = b~aufpl
        and c~aplzl = b~aplzl
        join mara as d
        on d~matnr = b~matnr
             WHERE  a~AUFNR  in s_aufnr
             AND    a~AUART  in s_auart
             AND    a~GLTRP  in s_gltrp
             AND    a~GSTRP  in s_gstrp
             AND    a~FEVOR  in s_fevor.
        append gt_sele_tab.
      ENDSELECT.
      loop at gt_sele_tab.
        clear g_objnr.
        concatenate 'OR' gt_sele_tab-aufnr into g_objnr.
    *append
        select *  from jest
          where objnr = g_objnr
          and   inact ne 'X'.
          gt_status_tab-aufnr = gt_sele_tab-aufnr.
          gt_status_tab-stat = jest-stat.
          append gt_status_tab.
        ENDSELECT.
        SELECT single arbpl into gt_sele_tab-arbpl
                 FROM  CRHD
               WHERE  OBJTY  = 'A'
               AND    OBJID  = gt_sele_tab-aufpl.
        gt_sele_tab-arbpl = '200'.
        MODIFY gt_sele_tab.
      endloop.
      perform fill_nodes.
      perform tree_display.
    **& Form FILL_NODES
    **text
    **--> p1 text
    **<-- p2 text
    form fill_nodes .
      DATA: L_ARBPL type arbpl.
      node_table-type = 'T'.
      node_table-name = 'Arbejdsplads'.
      node_table-tlevel = '01'.
      node_table-nlength = '15'.
    *  node_table-color = '4'.
      node_table-text = ''.
      node_table-tlength = '20'.
      node_table-tcolor = '3'.
      append node_table.
      clear node_table.
      loop at gt_sele_tab.
        at new arbpl.
          node_table-type = 'P'.
          node_table-name = gt_sele_tab-arbpl.
          node_table-tlevel = '02'.
          node_table-nlength = '20'.
    *      node_table-color = '4'.
          node_table-text = ''.
          node_table-tlength = '30'.
          node_table-tcolor = '3'.
          append node_table.
          clear node_table.
          L_ARBPL = gt_sele_tab-arbpl.
    *node_table-type = 'P'.
    *node_table-name = 'ITEM DATA'.
    *node_table-tlevel = '03'.
    *node_table-nlength = '20'.
    *node_table-color = '4'.
    *node_table-text = ''.
    *node_table-tlength = '30'.
    *node_table-tcolor = '3'.
    *append node_table.
    *clear node_table.
    break g-lmn.
          loop at gt_sele_tab where arbpl = l_arbpl.
            node_table-type = 'P'.
            node_table-name = gt_sele_tab-aufnr.
            node_table-tlevel = '04'.
            node_table-nlength = '20'.
    *        node_table-color = '4'.
    node_table-parent = '04'.
            node_table-text = ''.
            node_table-tlength = '30'.
            node_table-tcolor = '3'.
            node_table-TPOS2 = '2'.
            node_table-text2 = 'halløj'.
            node_table-TPOS3 = '3'.
            node_table-text3 = 'igen'.
            append node_table.
            clear node_table.
    *        break g-lmn.
            node_table-type = 'P'.
    *        node_table-name = 'Materiale'.
    *        node_table-tlevel = '04'.
    node_table-parent = '04'.
            node_table-nlength = '20'.
    *        node_table-color = '4'.
            node_table-text1 = gt_sele_tab-matnr.
            node_table-TPOS2 = '2'.
            node_table-text2 = 'halløj'.
            node_table-TPOS3 = '3'.
            node_table-text3 = 'igen'.
            node_table-tlength1 = '40'.
            node_table-tcolor1 = '3'.
            append node_table.
            clear node_table.
    *        node_table-type = 'P'.
    *        node_table-name = 'UNIT'.
    *        node_table-tlevel = '05'.
    *        node_table-nlength = '20'.
    **        node_table-color = '4'.
    *        node_table-text2 = 'test'.
    *        node_table-tlength2 = '30'.
    *        node_table-tcolor2 = '3'.
    *        append node_table.
    *        clear node_table.
    *node_table-type = 'P'.
    *node_table-name = 'QUANTITY'.
    *node_table-tlevel = '05'.
    *node_table-nlength = '20'.
    *node_table-color = '4'.
    *node_table-text = i_vbap-kwmeng.
    *node_table-tlength = '40'.
    *node_table-tcolor = '3'.
    *append node_table.
    *clear node_table.
    *node_table-type = 'P'.
    *node_table-name = 'DESCRIPTION'.
    *node_table-tlevel = '05'.
    *node_table-nlength = '20'.
    *node_table-color = '4'.
    *node_table-text = i_vbap-arktx.
    *node_table-tlength = '30'.
    *node_table-tcolor = '3'.
    *append node_table.
    *clear node_table.
    *endloop.
          endloop.
        endat.
    *loop at i_likp where vbelv = i_vbak-vbeln.
    *node_table-type = 'P'.
    *node_table-name = 'DELIVERY'.
    *node_table-tlevel = '03'.
    *node_table-nlength = '20'.
    *node_table-color = '4'.
    *node_table-text = ''.
    *node_table-tlength = '30'.
    *node_table-tcolor = '3'.
    *append node_table.
    *clear node_table.
    *node_table-type = 'P'.
    *node_table-name = i_likp-vbeln.
    *node_table-tlevel = '04'.
    *node_table-nlength = '20'.
    *node_table-color = '4'.
    *node_table-text = ''.
    *node_table-tlength = '30'.
    *node_table-tcolor = '3'.
    *append node_table.
    *clear node_table.
    *endloop.
    *loop at i_vbrk where vbelv = i_vbak-vbeln.
    *node_table-type = 'P'.
    *node_table-name = 'INVOICE'.
    *node_table-tlevel = '03'.
    *node_table-nlength = '15'.
    *node_table-color = '4'.
    *node_table-text = ''.
    *node_table-tlength = '20'.
    *node_table-tcolor = '3'.
    *append node_table.
    *clear node_table.
    *node_table-type = 'P'.
    *node_table-name = i_vbrk-vbeln.
    *node_table-tlevel = '04'.
    *node_table-nlength = '20'.
    *node_table-color = '4'.
    *node_table-text = ''.
    *node_table-tlength = '30'.
    *node_table-tcolor = '3'.
    *append node_table.
    *clear node_table.
    *endloop.
      endloop.
    endform. " FILL_NODES
    **& Form TREE_DISPLAY
    **text
    **--> p1 text
    **<-- p2 text
    form tree_display .
      call function 'RS_TREE_CONSTRUCT'
      exporting
      insert_id = '000000'
      relationship = ' '
    *LOG =
      tables
      nodetab = node_table
      exceptions
      tree_failure = 1
      id_not_found = 2
      wrong_relationship = 3
      others = 4
    *if sy-subrc = 0.
    *message id sy-msgid type sy-msgty number sy-msgno
    *with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    *endif.
      call function 'RS_TREE_LIST_DISPLAY'
      exporting
    *CALLBACK_PROGRAM =
      callback_user_command = 'USER_COMMAND'
    *CALLBACK_TEXT_DISPLAY =
    *CALLBACK_MOREINFO_DISPLAY =
    *CALLBACK_COLOR_DISPLAY =
    *CALLBACK_TOP_OF_PAGE =
    *CALLBACK_GUI_STATUS =
    *CALLBACK_CONTEXT_MENU =
      status = 'IMPLICIT'
      check_duplicate_name = '1'
    *color_of_node = '4'
    *color_of_mark = '3'
    *color_of_link = '1'
    *color_of_match = '5'
      lower_case_sensitive = ' '
      modification_log = ' '
      node_length = 30
      text_length = 75
      text_length1 = 0
      text_length2 = 0
      return_marked_subtree = ' '
      screen_start_column = 0
      screen_start_line = 0
      screen_end_column = 0
      screen_end_line = 0
      suppress_node_output = ' '
      layout_mode = ' '
      use_control = 'F'
    *IMPORTING
    *F15 =
    endform.                    "tree_display
    " FINAL_DISPLAY

    Hi,
    Have you checked the examples in SALV_OBJECTS?
    /wg

  • How to open PDF URL with highlighting search term ?

    Hello
    I am trying to open a PDF URL in a browser and would like the PDF to open at the page coataining the first hit of a specific term and at the same time highlighting all occurences found in the document.
    Apparently one way to do it is to add this #search=termsearched to the URL such as in http://thePdfUrl#search=termsearched
    However this seems to work in some cases but not all the time. Kind of issues I am seeing are:
    1 - Once you open the PDF the search string does not get highlighted in  some cases and the left nave (search window) does not come in focus as a  default view.)
    2 - Another issues identified  it is striping the 1st and last chars from the keyword.
    3- Initial search doesn't seem to always work...Only if you open the pdf a second time the find funcionality seems to work as expected.
    Is there a better way to do this and to avoid these inconsistencies and have a more robust behaviour ?
    Thanks

    Hi,
    I have the exact same problem but I don't have a bar. I'm trying to use this URL "http://translate.google.com/#auto/en/" but the script changes the # to %23. Any ideas? Thanks
    Edit:
    OK, that's starting to get weird. I tried using this URL instead "http://translate.google.com/#auto%7Cen%7C". When I put it directly in the browser it works which means that it is correct. When I use it through Automator it keeps changing the # to %23. Now the weird part. If I put #fr like the original poster it doesn't change it. It only change it with #auto. Anyone have any suggestions? Thank you.
    Message was edited by: j.giazlas

  • How to create Hierarchy Tree Node structure?

    Hi experts,
              I want to know how to create a tree with kind of below Structure:
    Root A
             NodeA1
                  ITEMA1_IT1
                  ITEMA1_IT2
                  ITEMA1_IT3
             NodeA2
                  ITEMA2_IT1
                  ITEMA2_IT2
             NodeA3
                  ITEMA3_IT1
                  ITEMA3_IT2
                  ITEMA3_IT3
                  ITEMA3_IT4
    So when i click on Root A it shows me, NODEA1, NODEA2 & NODEA3....
    when further i click on NODEA1, it shows me items like  ITEMA1_IT1,ITEMA1_IT2, ITEMA1_IT3.
    when further i click on NODEA2, it shows me items like  ITEMA2_IT1,ITEMA2_IT2.
    SO item will get loaded when i click on perticular node.
    how its possible.
    I have gone through SDN so many threads, bt i didn't get exactly for webdynpro ABAP.
    Please guide me for the same.
    Thanks ,
    Saurin Shah

    Hi,
    you can create the tree you wanted as follows:
    1) create a node under your context say "root_node" with cardinality 1..1
    2) now create an attribute under it called "text" with type string.
    3) now create three nodes under this "root_node" called nodeA1 nodeA2 and nodeA3 with cardinality 0..n
    4) now under nodeA1 , nodeA2 and nodeA3 create an attribute called "text" with type string...so each node will have one attribute called "text" of type string...
    5) now create a node under nodeA1 called "itemA1" with cardinlity 0..n
    6) now create an attribute called "text" of type string under this node "itemA"...
    7) repeat step 5 and 6 for the other two nodes...nodeA2 and nodeA3
    8) now create six supply functionsthese functions will supply the text values for your nodes-
    I created like this:
    FILL_ITEM1
    FILL_ITEM2
    FILL_ITEM3
    FILL_NODEA1
    FILL_NODEA2
    FILL_NODEA3
    Note:*******************my view is called MAIN******************
    hence the coding is
    data
        lt_elements type if_main=>elements_nodea1.
    if you view is called view1...than the data declaration would be
    data
        lt_elements type if_view1=>elements_nodea1.
    9) go to each node and assign the supply function respectively....you can assign this by going to context tab and selecting the node you want to assign the supply function to and just type in the name of the supply funciton or do the help for that field by clicking on the little square btn...
    10) now we go the layout tab and put the tree ui on the layout....bind the datasource property to the context node "root_node"
    and bind the rootText property to the attribute "text" of the root_node...
    11) now right click on this tree ui element under the ROOTUIELEMENTCONTAINER and select "insert node type" ...a box will appear where you can see it has two types of node for you....one is tree_node_type and other one is tree_item_type...
    create three nodes with tree_node_type with names "nodeA1" nodeA2 and nodeA3 and three with tree_item_type with names "itemA1" itemA2 and itemA3...
    12) now bind all these node types and item types data sources and texts with corresponding nodes and attributes under your context...
    so nodeA1datasource will get bind to context nodeA1 and itemA1 data source will get bind to itemA1 from context..and so on...
    13) now in the wddoinit method: I setup the text for the root node.....
    DATA lo_nd_root_node TYPE REF TO if_wd_context_node.
      DATA lo_el_root_node TYPE REF TO if_wd_context_element.
      DATA ls_root_node TYPE wd_this->element_root_node.
      DATA lv_root_txt TYPE wd_this->element_root_node-root_txt.
    navigate from <CONTEXT> to <ROOT_NODE> via lead selection
      lo_nd_root_node = wd_context->get_child_node( name = wd_this->wdctx_root_node ).
    get element via lead selection
      lo_el_root_node = lo_nd_root_node->get_element( ).
    @TODO fill attribute
    lv_root_txt = 'Root Node'.
    set single attribute
      lo_el_root_node->set_attribute(
        name =  `ROOT_TXT`
        value = lv_root_txt ).
    hope this will give you the solution you are looking for...
    Thanks...
    AS...........

  • How can I search the tree with a given string?

    How can I search the tree with a given string?
    I don't find any function like "search(...)".
    I want to find the tree nodes which include the given string.
    Thanks.

    Try it with .com instead of .ca - fixes it for me (corporate firewall blocks .ca here)
    http://spendolini.blogspot.com/2013/09/working-with-apex-tree.html
    Anyway - it links to an article of mine which describes interacting with the tree: Tom's Blog: Working with the tree in Apex. There is also a demo application on apex.oracle.com: http://apex.oracle.com/pls/apex/f?p=54687:38

  • How to build a BIG TREE with Tree-Form layout

    Hi,
    I do have a self-referenced table with our org structure - 15 000 positions.
    I do want to create a tree with this structure.
    Requirements :
    a, to have a tree-form layout
    b, to have search capabilities
    I have tried to use several combinations (maybe all)
    - from using only one View object and create recursive tree - doesn't even run
    - to use two View objects, first as top level nodes, the other as the rest - it runs
    but I can search only top level, and what is worse, by clicking on the node for showing additional information (tree-form layout) I'm waiting for ages for seeing the info
    (it seems that all records are loaded one by one into AS)
    Could you provide some ideas how to deal with this ?
    Thanks.

    I am sorry, this is beyond the scope of this forum.
    As with any functionality not directly provided by JHeadstart, you can build it yourself using the ADF design time tools in JDeveloper. Please use the JDeveloper forum for help on this first step.
    Then, to keep your pages generatable you can move these customizations to custom templates. We are happy to help you with this last step, should you have problems there.
    Steven Davelaar,
    JHeadstart Team.

  • Using depth first traversal to add a new node to a tree with labels

    Hello,
    I'm currently trying to work my way through Java and need some advice on using and traversing trees. I've written a basic JTree program, which allows the user to add and delete nodes. Each new node is labelled in a sequential order and not dependent upon where they are added to the tree.
    Basically, what is the best way to add and delete these new nodes with labels that reflect their position in the tree in a depth-first traversal?
    ie: the new node's label will correctly reflect its position in the tree and the other labels will change to reflect this addition of a new node.
    I've searched Google and can't seem to find any appropriate examples for this case.
    My current code is as follows,
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    public class BasicTreeAddDelete extends JFrame implements ActionListener
        private JTree tree;
        private DefaultTreeModel treeModel;
        private JButton addButton;
        private JButton deleteButton;
        private int newNodeSuffix = 1;
        public BasicTreeAddDelete() 
            setTitle("Basic Tree with Add and Delete Buttons");
            DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Root");
            treeModel = new DefaultTreeModel(rootNode);
            tree = new JTree(treeModel);
            JScrollPane scrollPane = new JScrollPane(tree);
            getContentPane().add(scrollPane, BorderLayout.CENTER);
            JPanel panel = new JPanel();
            addButton = new JButton("Add Node");
            addButton.addActionListener(this);
            panel.add(addButton);
            getContentPane().add(panel, BorderLayout.SOUTH);
            deleteButton = new JButton("Delete Node");
            deleteButton.addActionListener(this);
            panel.add(deleteButton);
            getContentPane().add(panel, BorderLayout.SOUTH);    
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setSize(400, 300);
            setVisible(true);
        public void actionPerformed(ActionEvent event) 
            DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
            if(event.getSource().equals(addButton))
                if (selectedNode != null)
                    // add the new node as a child of a selected node at the end
                    DefaultMutableTreeNode newNode = new DefaultMutableTreeNode("New Node" + newNodeSuffix++);
                      treeModel.insertNodeInto(newNode, selectedNode, selectedNode.getChildCount());
                      //make the node visible by scrolling to it
                    TreeNode[] totalNodes = treeModel.getPathToRoot(newNode);
                    TreePath path = new TreePath(totalNodes);
                    tree.scrollPathToVisible(path);               
            else if(event.getSource().equals(deleteButton))
                //remove the selected node, except the parent node
                removeSelectedNode();           
        public void removeSelectedNode()
            DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
            if (selectedNode != null)
                //get the parent of the selected node
                MutableTreeNode parent = (MutableTreeNode)(selectedNode.getParent());
                // if the parent is not null
                if (parent != null)
                    //remove the node from the parent
                    treeModel.removeNodeFromParent(selectedNode);
        public static void main(String[] arg) 
            BasicTreeAddDelete basicTree = new BasicTreeAddDelete();
    }      Thank you for any help.

    > Has anybody got any advice, help or know of any
    examples for this sort of problem.
    Thank you.
    Check this site: http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-JTree.html

  • How do I traverse a tree component ?

    How do I traverse a tree component ?
    I tried the following but it only returns 1 row. The dataprovider is XML.
    var datalength:Number = mytree.dataProvider.length;
    Alert.show(String(datalength));
    for ( var i:Number = 0; i < datalength; i++)
          Alert.show(mytree.dataProvider.getItemAt(i).@label); 

    I went with the following approach
    for each  
    (var attribute:XML in treeSource..@*)
         Alert.show((attribute.parent( ).@label
         +
    ": " + attribute.name( ) + "=" + attribute));}

Maybe you are looking for

  • Error while creating an external content type using wcf service.

    Hi!   I have been asked to create a wcf service to expose sql data and populate them in a list using external content type.i have created the service but while creating the content type it gives me error. Can anyone suggest me about which url should

  • Interlaced? (jagged lines) issue when burning a disc

    I uploaded some standard definition DVD-R footage into my 2011 iMac (550gb). To get the DVD-R's vob footage into FCPX for editing, I first transferred the vob's to QT MOV's via MPEG Streamclip. I then imported it into FCPX as is (SD 640x480), then ed

  • Can't open a saved interactive form

    I have developed an interactive form using ABAP WebDynpro. While I have the form displayed (with or without having filled in any values), I use the "save" button on the standard Adobe toolbar (i.e. not anything I programmed myself) to save the form t

  • How do I convert scanned tif file to pdf file?

    How do I convert a scanned tif file to a pdf file?

  • MacBook Pro Retina problem

    I have a brand new MacBook Pro 13 inch with retina display, i downloaded the game Worms from the App Store and started playing while i was playing the game my trackpad didn´t work normaly, I have the pulse option to make click enabled in my mac so i