Tree Structured Queries

Hi,
i'm making a program that can use any sql compliant database.
That is, it can run with Oracle, SQL Server, ...
In my database, I need to keep data that i will show to the user
in the form of a tree.
There's no problem whith oracle. I use SELECT ... CONNECT BY ..
PRIOR ... START WITH ...
But there is no such thing with SQL Server.
Does someone know how i can populate a tree without using
CONNECT BY ?
Thanks in advance, Jonathan.

I think that the source of your problem is in assuming that there is such a thing as a sql compliant database, and I fear that you may be on a "fool's errand" in trying to design an application to use any type of generic sql. Read http://www.oracle.com/oramag/webcolumns/2001/4826_Chap01.pdf to find out why, then consider buying the book.
I think that your question might be better put to a SQL Server audience, but the only generic way of doing this that I can think of would be to do multiple sef-joins on the table. not very efficient

Similar Messages

  • Query for spesific children in a tree structure

    Hi,
    My data is organized in a tree structure.
    I need a sql statement that returns a parent that
    have a set of children corresponding to some demands.
    I provide a very simplified description of my data, but it covers my problem.
    Can anyone please help me write a select statement that gives me all featureids
    that have a GID attribute with children GNR=123 AND BNR=456?
    Regards
    gv
    create table attributetype( id number, name varchar2(8), parentid number );
    insert into attributetype( id, name ) values ( 1, 'GIDLIST' );
    insert into attributetype( id, name, parentid ) values ( 2, 'GID', 1 );
    insert into attributetype( id, name, parentid ) values( 3, 'GNR', 2 );
    insert into attributetype( id, name, parentid ) values ( 4, 'BNR', 2 );
    create table attribute( featureid number, id number, parentid number, atttypeid number, intvalue number );
    --attributes for feature1
    insert into attribute( featureid, id, parentid, atttypeid ) values( 1, 1, 0, 1 );
    insert into attribute( featureid, id, parentid, atttypeid ) values( 1, 2, 1, 2 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 3, 2, 3, 123 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 4, 2, 4, 456 );
    insert into attribute( featureid, id, parentid, atttypeid ) values( 1, 5, 1, 2 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 6, 5, 3, 12 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 7, 5, 4, 456 );
    --attributes for feature 2
    insert into attribute( featureid, id, parentid, atttypeid ) values( 2, 8, 0, 1 );
    insert into attribute( featureid, id, parentid, atttypeid ) values( 2, 9, 8, 2 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 10, 9, 3, 678 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 11, 9, 4, 456 );
    insert into attribute( featureid, id, parentid, atttypeid ) values( 2, 12, 8, 2 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 13, 12, 3, 876 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 14, 12, 4, 456 );
    commit;
    column name format a15
    select a.featureid featureid, lpad(' ', (level - 1) * 2) || b.name name, a.id attid, a.parentid parentid, a.intvalue
    from attribute a, attributetype b
    where a.atttypeid=b.id
    connect by prior a.id=a.parentid
    start with a.parentid=0;
    FEATUREID NAME ATTID PARENTID INTVALUE
    1 GIDLIST 1 0
    1 GID 2 1
    1 GNR 3 2 123
    1 BNR 4 2 456
    1 GID 5 1
    1 GNR 6 5 12
    1 BNR 7 5 456
    2 GIDLIST 8 0
    2 GID 12 8
    2 GNR 13 12 876
    2 BNR 14 12 456
    2 GID 9 8
    2 GNR 10 9 678
    2 BNR 11 9 456

    Hi,
    Thanks for providing the CREATE TABLE and INSERT statements; that helps a lot.
    You want featureids that meet three criteria:
    (1) there is a GID attribute
    (2) the GID attribute has a GNR child with intvalue=123
    (3) the GID attribute has a BNR child with intvalue=456
    Since you're looking for immediate children, not distant descendants, it's easiest to do this with a non-hierarrchical query that finds one of these criteria, and does EXISTS sub-queries to test for the other two.
    For example:
    WITH aat AS
    ( -- Begin aat: join of attribute and attributetype
         SELECT     a.featureid
         ,     a.id
         ,     a.parentid
         ,     a.intvalue
         ,     t.name
         FROM     attribute     a
         JOIN     attributetype     t     ON     a.atttypeid     = t.id
    ) -- End aat: join of attribute and attributetype
    SELECT DISTINCT     featureid
    FROM     aat     m     -- m for main
    WHERE     name     = 'GID'
    AND     EXISTS     (     -- Begin EXISTS sub-query for GNR=123
              SELECT     NULL
              FROM     aat
              WHERE     parentid     = m.id
              AND     name          = 'GNR'
              AND     intvalue     = 123
              )     -- End EXISTS sub-query for GNR=123
    AND     EXISTS     (     -- Begin EXISTS sub-query for BNR=456
              SELECT     NULL
              FROM     aat
              WHERE     parentid     = m.id
              AND     name          = 'BNR'
              AND     intvalue     = 456
              )     -- End EXISTS sub-query for BNR=456
    ;Alternatively, you could do a three-way self join, and skip the EXISTS sub-queries.
    If you were looking for GNR and BNR descendants, any number of levels below the same GID node, it's easy to modify the query above. Just re-write the EXISTS sub-queries to CONNECT BY queries that "START WITH parentid = m.id".
    It looks like this application will have a lot of use for a view like aat, above. If you don't already have a permanent view like that, you should create one.

  • How to create a tree structure using forms.

    Hi,
    How do i create a tree structure using oracle forms,i have a table named Functions and a specific column 'Function Name' should be displayed in the tree nodes.Can anyone help me out on how to create a tree structure and populating the nodes??
    thanks in advance
    Regards
    Karthik

    The FTree package provides functions to populate the tree - look for the topic "Manipulating a hierarchical tree at runtime
    " in the online help this point to all the functions and triggers

  • How to show alv report in tree structure

    hi all,
    how to show data or create a alv report in tree structure.
    thanks in advance.
    Harsha

    Hi Harsha,
    Its done using FM 'RS_TREE_CONSTRUCT'
    and FM for displaying the tree:  'RS_TREE_LIST_DISPLAY'
    Thanks
    Shrila

  • How to get Text for nodes in Tree Structure

    Hi Friends,
    How to get Text for nodes in Tree Structure
    REPORT  YFIIN_REP_TREE_STRUCTURE  no standard page heading.
                       I N I T I A L I Z A T I O N
    INITIALIZATION.
    AUTHORITY-CHECK OBJECT 'ZPRCHK_NEW' :
                      ID 'YFIINICD' FIELD SY-TCODE.
      IF SY-SUBRC NE 0.
        MESSAGE I000(yFI02) with SY-TCODE .
        LEAVE PROGRAM.
      ENDIF.
    class screen_init definition create private.
    Public section
      public section.
        class-methods init_screen.
        methods constructor.
    Private section
      private section.
        data: container1 type ref to cl_gui_custom_container,
              container2 type ref to cl_gui_custom_container,
              tree type ref to cl_gui_simple_tree.
        methods: fill_tree.
    endclass.
    Class for Handling Events
    class screen_handler definition.
    Public section
      public section.
        methods: constructor importing container
                   type ref to cl_gui_custom_container,
                 handle_node_double_click
                   for event node_double_click
                   of cl_gui_simple_tree
                   importing node_key .
    Private section
      private section.
    endclass.
    *&                        Classes implementation
    class screen_init implementation.
    *&                        Method INIT_SCREEN
      method init_screen.
        data screen type ref to screen_init.
        create object screen.
      endmethod.
    *&                        Method CONSTRUCTOR
      method constructor.
        data: events type cntl_simple_events,
              event like line of events,
              event_handler type ref to screen_handler.
        create object: container1 exporting container_name = 'CUSTOM_1',
                       tree exporting parent = container1
                         node_selection_mode =
                cl_gui_simple_tree=>node_sel_mode_multiple.
        create object: container2 exporting container_name = 'CUSTOM_2',
        event_handler exporting container = container2.
    event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
        event-appl_event = ' '.   "system event, does not trigger PAI
        append event to events.
        call method tree->set_registered_events
             exporting events = events.
        set handler event_handler->handle_node_double_click for tree.
         call method: me->fill_tree.
      endmethod.
    *&                        Method FILL_TREE
      method fill_tree.
        data: node_table type table of abdemonode,
              node type abdemonode.
    types:    begin of tree_node,
              folder(50) type c,
              tcode(60) type c,
              tcode1(60) type c,
              tcode2(60) type c,
              text(60) type c,
              text1(60) type c,
              text2(60) type c,
              end of tree_node.
      data:  wa_tree_node type tree_node,
                t_tree_node type table of tree_node.
    wa_tree_node-folder = text-001.
    wa_tree_node-tcode  = text-002.
    wa_tree_node-text =  'Creditors ageing'.
    wa_tree_node-tcode1 = text-003.
    wa_tree_node-text1 =  'GR/IR aging'.
    wa_tree_node-tcode2 = text-004.
    wa_tree_node-text2 =  'Bank Balance'.
    append wa_tree_node to t_tree_node.
    clear wa_tree_node .
    wa_tree_node-folder = text-005.
    wa_tree_node-tcode  = text-006.
    wa_tree_node-text =  'Creditors ageing'.
    wa_tree_node-tcode1 = text-007.
    wa_tree_node-text1 =  'Creditors ageing'.
    wa_tree_node-tcode2 = text-008.
    wa_tree_node-text2 =  'Creditors ageing'.
    append wa_tree_node to t_tree_node.
    clear wa_tree_node .
    wa_tree_node-folder = text-009.
    wa_tree_node-tcode  = text-010.
    wa_tree_node-text =  'Creditors ageing'.
    wa_tree_node-tcode1 = text-011.
    wa_tree_node-text1 =  'Creditors ageing'.
    wa_tree_node-tcode2 = text-012.
    wa_tree_node-text2 =  'Creditors ageing'.
    append wa_tree_node to t_tree_node.
    clear wa_tree_node .
    node-hidden = ' '.                 " All nodes are visible,
        node-disabled = ' '.               " selectable,
        node-isfolder = 'X'.                                    " a folder,
        node-expander = ' '.               " have no '+' sign forexpansion.
        loop at t_tree_node into wa_tree_node.
          at new folder.
            node-isfolder = 'X'.                      " a folder,
            node-node_key = wa_tree_node-folder.
                   clear node-relatkey.
            clear node-relatship.
            node-text = wa_tree_node-folder.
            node-n_image =   ' '.
            node-exp_image = ' '.
            append node to node_table.
          endat.
         at new tcode .
            node-isfolder = ' '.                          " a folder,
            node-n_image =   '@CS@'.       "AV is the internal code
            node-exp_image = '@CS@'.       "for an airplane icon
            node-node_key = wa_tree_node-tcode.
             node-text = wa_tree_node-text .
                     node-relatkey = wa_tree_node-folder.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
          endat.
          append node to node_table.
        at new tcode1 .
            node-isfolder = ' '.                          " a folder,
            node-n_image =   '@CS@'.       "AV is the internal code
            node-exp_image = '@CS@'.       "for an airplane icon
            node-node_key = wa_tree_node-tcode1.
                     node-relatkey = wa_tree_node-folder.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
              node-text = wa_tree_node-text1.
         endat.
          append node to node_table.
           at new tcode2 .
            node-isfolder = ' '.                          " a folder,
            node-n_image =   '@CS@'.       "AV is the internal code
            node-exp_image = '@CS@'.       "for an airplane icon
            node-node_key = wa_tree_node-tcode2.
                     node-relatkey = wa_tree_node-folder.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
            node-text = wa_tree_node-text2.
         endat.
          append node to node_table.
        endloop.
        call method tree->add_nodes
             exporting table_structure_name = 'ABDEMONODE'
                       node_table = node_table.
      endmethod.
    endclass.
    *&                        Class implementation
    class screen_handler implementation.
    *&                        Method CONSTRUCTOR
      method constructor.
       create object: HTML_VIEWER exporting PARENT = CONTAINER,
                      LIST_VIEWER exporting I_PARENT = CONTAINER.
      endmethod.
    *&                 Method HANDLE_NODE_DOUBLE_CLICK
      method handle_node_double_click.
      case node_key(12).
    when 'Creditors'.
    submit YFIIN_REP_CREADITORS_AGING  via selection-screen and return.
    when  'Vendor'.
    submit YFIIN_REP_VENDOR_OUTSTANDING  via selection-screen and return.
    when 'Customer'.
    submit YFIIN_REP_CUSTOMER_OUTSTANDING  via selection-screen and
    return.
    when 'GR/IR'.
    submit YFIIN_REP_GRIR_AGING  via selection-screen and return.
    when 'Acc_Doc_List'.
    submit YFIIN_REP_ACCOUNTINGDOCLIST  via selection-screen and return.
    when 'Bank Bal'.
    submit YFIIN_REP_BANKBALANCE  via selection-screen and return.
    when 'Ven_Cus_Dtl'.
    submit YFIIN_REP_VENDORCUST_DETAIL via selection-screen and return.
    when 'G/L_Open_Bal'.
    submit YFIIN_REP_OPENINGBALANCE via selection-screen and return.
    when 'Usr_Authn'.
    submit YFIIN_REP_USERAUTHRIZATION via selection-screen and return.
    endcase.
      endmethod.
    endclass.
    Program execution ************************************************
    load-of-program.
      call screen 9001.
    at selection-screen.
    Dialog Modules PBO
    *&      Module  STATUS_9001  OUTPUT
          text
    module status_9001 output.
      set pf-status 'SCREEN_9001'.
      set titlebar 'TIT_9001'.
      call method screen_init=>init_screen.
    endmodule.                 " STATUS_9001  OUTPUT
    Dialog Modules PAI
    *&      Module  USER_COMMAND_9001  INPUT
          text
    module user_command_9001 input.
    endmodule.                 " USER_COMMAND_9001  INPUT
    *&      Module  exit_9001  INPUT
          text
    module exit_9001 input.
    case sy-ucomm.
    when 'EXIT'.
      set screen 0.
    endcase.
    endmodule.
            exit_9001  INPUT

    you can read  the table node_table with nody key value which imports when docubble click the the tree node (Double clifk event).
    Regards,
    Gopi .
    Reward points if helpfull.

  • How to use ONE query to find out tree structure?

    ID------------upperID----------Name------------------------isFolder
    1------------ 0---------- Folder
    1------------------------------------1
    2------------ 1------------ Folder 1- Sub
    Folder--------------------1
    3------------ 2------------
    Folder1-Item1-A--------------------------0
    4------------ 1------------ Folder 1- Sub
    Item-----------------------0
    Hi all, if I have a table like above to demonstrate the
    folders and item relationship. This structure allows the user to
    create unlimited folders and items.
    Now I would like to use one query to find out the tree
    structure of this table, how could I do the query.
    Any help on this will be highly appreciated!
    Thanks,
    ez

    Also, see this thread:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=12 55788&enterthread=y

  • How to create a form on a tree structured table

    Hi,
    I have a table that is designed to do a tree structure  like:
    Table Name: test
    Fields:
    ID
    ParentID
    Description
    I created a browser (IR) (page 1) that calls a form (page 2)
    The form has the editing fields and at the bottom layer I have a reports region where I display the children records using a query like:
    select * from test where ParentID = :P2_ID
    I need at the region level to add a button to call a form to edit the child record (which is the same table) and when done, to return to the form again but to the parent record.
    How can I do that successfully? Is there any example:?
    Thank you

    Maybe this can help:
    http://apex.oracle.com/pls/otn/f?p=31517:157
    using instead of trigger on a view.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to create Tree structure in Visual Composer

    Hi All,
         I need to develop tree structure in my VC application. Can any one of you please suggest me the steps to do it.Its very urgent please can any one help me out in this.
    Regards,
    Lakshmi

    Hi Nutan,
    if you want to solve it with webdynpro it depends on your skills in java and abap. There are books available to start with webdynpro and there are examples for building tree structures with Webdynpro.
    [Java Webdynpro|http://www.sappress.com/product.cfm?account=&product=H983]
    [ABAP Webdynpro|http://www.sappress.com/product.cfm?account=&product=H1916]
    If you want to do it in VC you have to write e.g. an ABAP rfc function module, which returns you the tree with the information about childnode, parentnode and so on, so that you can display it in the table. But if the users click on sort then the tree is "destroyed". You can also display only a few levels of your tree and when you select a certain node a drill down is done by calling a rfc which returns the child nodes of the corresponding node.
    But I think the solution with VC is not the best. Use webdynpro for this requirements.
    Best Regards,
    Marcel

  • How to get Tree structure in JSP page?

    Hi,
    I would like get data from the database and display the data in tree structure with the check boxes at each nodes on a jsp page with out using any third party tools. how can i do that? Do i require any new tags to fulfill this requirement?
    can any one help me out by sending any example code?
    thanks in advance.
    Regards,
    Reddy

    Once you have the data in a list or something, can't you just use <c:forEach> and then output standard nested <ul> and <li> tags to give the tree structure.
    <html>
         <style>
              li
                   list-style-type:none;
         </style>
         <body>
              <form>
                   <ul>
                        <li>
                             <input type="checkbox">Check 1</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 1A</input>
                                  </li>
                                  <li>
                                       <input type="checkbox">Check 1B</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 2</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 2A</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 3</input>
                        </li>
                   </ul>
              </form>
         </body>
    </html>

  • How can I create a Tree  Structure in java ??

    Hi,
    I want to create a tree structure(objects hierarchy) using java language. Is there any API method for this ?
    Can any one please give me a hint or suggestion how I can do this ??
    Thanks for the help in advance.

    Do you mean graphically?
    You can use a TreeSet or TreeMap if you just want to use tree structures.
    Kaj

  • How to get tree structure navigation in module pool program

    please send me a sample code for getting tree structure navigation in a screen  in module pool program.
    ex.
    masters
    items

    do a chain and endchain on the fields.Then insert the fields in to the required database.

  • How to get the folder name of selected subitem in tree structure?

    Hi All,
               I created a tree structure like below.
             ->Folder1-- 1
                              2
                              3
            ->Folder2-----1
                               2
                               3
                    i.e i have two folders & each folder having the values like above.Now i want to perform some action by clicking on the any of the values.Suppose if i click value 2,i want to do some action.the actions need to perform is varies from floder to to folder.
            So How can i get the folder name of clicked Value?
    Regards,
    Ravi

    Hi Kumar ,
    the below code should help you.
    Register the below action for the leaf node for which u need the subfolder's name above it.
    Worked fine in my system ...hope it does in ur scenario too
    method ONACTIONGET_PATH .
      data : lr_element TYPE REF TO if_wd_context_element,
             lr_node TYPE REF TO if_wd_context_node,
             ls_path type string,
             ls_path_node TYPE string,
             lt_string type TABLE OF string,
             l_lines type i,
             l_lines_1 TYPE i.
      lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
    **-> getting the path of the node/leaf
    *which  u had clicked and from that getting the node above it
      ls_path = lr_element->get_path( ).
      SPLIT ls_path at '.' into table lt_string.
    -> remove the first 2 entries as they will contain the view name
      DELETE lt_string FROM 1 to 2.
      l_lines = LINES( lt_String ).
      l_lines_1 = l_lines - 1.
    -> remove the last 2 entries as they will contain the element in the path
      DELETE lt_string  from l_lines_1 to l_lines.
      LOOP AT lt_string into ls_path.
        CONCATENATE LINES OF LT_STRING into ls_path_node SEPARATED BY '.'.
      ENDLOOP.
    **-> getting access to the node above the leaf element
    LR_NODE = WD_CONTEXT->PATH_GET_NODE( path = ls_path_node ).
    lr_element = lr_node->get_element( ).
    **-> Getting the name of the folder...
    *here path is the attribute in my context which stores the name of the folder
    lr_element->get_attribute( EXPORTING name = 'PATH' IMPORTING value = ls_path ).
    endmethod.

  • How to create a PortalSite map in a tree structure

    Hi,
    We are trying to reuse SAP Portal EP 7.3 standard functionalities related to create a Portal Site Map.
    I've seen the procedure to create a Workset map iview (http://help.sap.com/saphelp_nw73/helpdata/en/49/32a7a9e8c45aaae10000000a42189d/frameset.htm), but we are interested in generate this map contained in a tree structure, because currently the SAP EP 7.1 brings the menu and option format.
    I would like to know if this is possible using the standard functionalities or it is required to develop any application?
    Please if you could help me it would be really useful.
    Thanks in advance,

    Thanks for your help Srinivas,
    I was trying to know if it was possible to assign a style or layout to the site map iview created using the standard map iview delivered by SAP EP 7.3. I was looking for documentation but it is not enough at all and in my project we are still working with SAP EP 7.0
    Please, if anyone could know about the map site iview standard and the available styles or maybe it is not changeable.
    In that case, the only way it would be a development to get the tree structure.
    Thanks!!!!

  • I would like to know where the forum tree structure is so I can see what I'm doing and not be led around to irrelevant information.

    I'm having trouble '''Finding''' the forum where I can look for the information I need. I keep ending up in '''endless menus of non-helpful information. '''
    I got a popup message, I needed to upgrade to 3.6.17. After allowing it and rebooting, I couldn't start FF anymore, just got a crash report. I tried going to the restore point I had set with no luck and I tried creating a new profile. I lost all my bookmarks (only the Cache remained). And I sat in live chat for an hour waiting for help. German live chat had one helper and English live chat was closed.
    So I gave up on help, uninstalled FF 3.6.17 and downloaded FF 3.6.15 and installed it. It loads but all bookmarks are gone. More importantly, now when I load the bookmarks, I can't '''retrieve''' them except by storing a new one. '''Only''' when I create a new bookmark can I see the folders I've created. I can't get to the organizer so I can't use the bookmarks to retrieve websites.
    I'm disturbed that I can't get to the tree-structure forum where I can get the help I need. This "lead me around" labyrinth from one question to another, without being able to look through the forum for the information I need, is not helpful.
    Thank you.
    Foxhunt

    I believe you just are able to delete them from iTunes.
    Hope it will be helpful

  • How to populate Tree structure from BAPI while tree grows or shrinks

    Hi All
    Currently I am populating the tree structure from BAPI based on the HLevel (Hierarchy  Level) parameter, but when ever insertion and deletion happens in the tree at any level in the UI and at the same time i am updating these tree node values with HLevel value(example : 1 is first level , 2 is second level, 3 is third level etc)  updating successfully& correctly  into the BAPI, no issues.
    Once it is updated into the BAPI, next time when i refreshed the UI then i am not populating the tree structure correctly from BAPI with updated new nodes based on the HLevel. when tree struture grows or shrinks in the BAPI after updating into BAPI from UI then i am not populating the tree sturcture correctly based on the HLevel value from the BAPI.
    Please let me know any sample code how to populate tree structure correctly when tree structure grows or shrinks based on the HLevel value ( Hierarchy Level , for example : 1 is level , 2 is 2nd level , 3 is third level nodes etc)
    anybody helps in this regard with sample code on the populating tree tructure then it would be great help to me.
    Thanks in advance
    Regards
    Kalki Reddy
    Edited by: KalkiReddy on Nov 29, 2009 3:48 PM

    Bapi output node:
    Value     | Text     | HLevel
    01     | A     | 1               
    0101     | AA       | 2
    010101     | AAA     | 3
    01010B     | AAB     | 3
    0102     | AB     | 2
    02     | B     | 1
    0201     | BA        | 2
    This code is used to build the tree in wdDoInit method
         IE_T_CatalogueNode catalogueNode = wdContext.nodeE_T_Catalogue();
         int size = catalogueNode.size();
         ICatalogoElement level1elem = null;
         for (int i = 0; i < size; i ++)
              IE_T_CatalogueElement catalogueElem = catalogueNode.getE_T_CatalogueElementAt(i);
              if (catalogueElem.getLevel().equals("1"))
                   // 1 Livello
                   level1elem = wdContext.createCatalogoElement();
                   level1elem.setKATALOGART_CODE(catalogueElem.getKatalogart());
                   level1elem.setCODEGRUPPE_CODE(catalogueElem.getCodegruppe());
                   level1elem.setCODE(catalogueElem.getCode());
                   level1elem.setCODE_DESCR(catalogueElem.getKatalogart_Descr());
                   level1elem.setDESCR(catalogueElem.getKatalogart_Descr());
                   wdContext.nodeCatalogo().addElement(level1elem);
                   for (int j = i + 1; j < size; j ++)
                        IE_T_CatalogueElement catalogueElem2level =
                                                 catalogueNode.getE_T_CatalogueElementAt( j );
                        String level2 = catalogueElem2level.getLevel();
                        if (level2.equals("2"))
                             ICatalogoElement level2elem = level1elem.nodeChild().createCatalogoElement();
                             level2elem.setKATALOGART_CODE(catalogueElem2level.getKatalogart());
                             level2elem.setCODEGRUPPE_CODE(catalogueElem2level.getCodegruppe());
                             level2elem.setCODE(catalogueElem2level.getCode());
                             level2elem.setCODE_DESCR(catalogueElem2level.getCodegruppe_Descr());
                             level2elem.setDESCR(catalogueElem2level.getCodegruppe_Descr());
                             level1elem.nodeChild().addElement(level2elem);
                             for (int k = j + 1; k < size; k ++)
                                  IE_T_CatalogueElement catalogueElem3level =
                                                           catalogueNode.getE_T_CatalogueElementAt( k );
                                  String level3 = catalogueElem3level.getLevel();
                                  if (level3.equals("3"))
                                       ICatalogoElement level3elem = level2elem.nodeChild().createCatalogoElement();
                                       level3elem.setKATALOGART_CODE(catalogueElem3level.getKatalogart());
                                       level3elem.setCODEGRUPPE_CODE(catalogueElem3level.getCodegruppe());
                                       level3elem.setCODE(catalogueElem3level.getCode());
                                       level3elem.setCODE_DESCR(catalogueElem3level.getCode_Descr());
                                       level3elem.setDESCR(catalogueElem3level.getCode_Descr());
                                       level2elem.nodeChild().addElement(level3elem);
    Damiano

Maybe you are looking for

  • Can't trust this computer for iphone and ipad with Itunes

    hi all after updating to ios 7.1.1 on both my iphone 4s and ipad I keep getting this message when I connect my phone or ipad to my iMac :iTunes could not connect to this iPad. You do not have permission. then this : Do you want to allow this computer

  • Why is non-embedded artwork taking up 500% more space on iPod Classic

    Hi all Following on from this thread: How to tell if my mp3s have embedded artwork (artwork file bigger than it should be)? If anyone has a moment (anyone who does not embed artwork that is), would you mind comparing your PC Hard Drive and iPod in te

  • 0CRM_SRV_PROCESS_I - Extracts 0 records

    Hi Gurus, I am working on the extracting data from this extractor - 0CRM_SRV_PROCESS_I. (CRM 500) I have made changes using CRMD_order transaction. When I did a load into BW 7 from data source 0CRM_SRV_PROCESS_I, i can see no records(0), upon checkin

  • Producing sound logic pro

    Hey! if anybody could help me that would be great! When creating music, I record a guitar track just fine, but i then go to record another track and i then hit play and i can't hear my second track! i'm sorry i'm new to this!

  • Thunderbolt glitching randomly

    My new TBD was just arrived, and all was good. But after few days something like this happened: http://youtu.be/nszk5rQtkTY and it repeats always after few minut after TBD connect and TB socket is very hot. After glitching screen goes black, but all