How to create af:tree from single database Table

Hi,
i want to create tree Like this: and also we can add node anywhere.
Parent01
----|parent01-child01
--------|parent01-child01-child01
--------|parent01-child01-child02
-------------|parent01-child01-child02-child01
Parent02
----|parent02-child01
----|parent02-child02
--------|parent02-child02-child01
and for this i have created Table like this :
Table name Treetable
NODEID     NUMBER(38,0) --> Primary Key
NODENAME     VARCHAR2(50 BYTE) --> This is the name will display as a node
DESCRIPTION     VARCHAR2(255 BYTE)     
ROOTIND     CHAR(1 BYTE) --> to decide root node
SEQUENCENO     NUMBER(38,0)     --> order to display node
PARENTKEY     NUMBER(38,0) -->FK (refering to NODEID(PK) of this table)
But when i am creating tree, its showing root node for each row in the table. but my requirement is: The Row marked as ROOTIND='Y' , show that row only as Root (Example in above tree:Parent01 & Parent02 )
any help highly appreciated :)
Thanks
Pratap Rudra
Edited by: 995114 on Apr 30, 2013 2:50 PM

Hi,
check this http://www.oracle.com/technetwork/developer-tools/adf/learnmore/32-tree-table-from-single-vo-169174.pdf
Frank

Similar Messages

  • How to select alternate entries from the database table

    Hi Experts,
    can u help me, how to select alternate entries from the database table.
    Thanks

    As there is no concept of sequence (unless there is a field specifically included for the purpose), there is no meaning to "alternate" records.
    What table do you have in mind, what data does it hold, and why do you want alternate records?
    matt

  • How to fetch data from single database table using 2 internal tables.

    Hi friends,
    i am a new user of ABAP and also SDN.
    i need a help. 
    i want to fetch data from one database table based on primary keys of 2 internal tables.  how to put in where clause.
    Thanks in advance.

    hii
    refer to following code ..i hope it will help you
    SELECT matnr                         " Material Number
        FROM mara
        INTO TABLE i_mara
       WHERE matnr IN s_matnr.
      IF i_mara[] IS NOT INITIAL.
        SELECT matnr                       " Material Number
               werks                       " Plants
               prctr                       " Profit Center
          FROM marc
          INTO TABLE i_marc
           FOR ALL ENTRIES IN i_mara
         WHERE matnr = i_mara-matnr
           AND werks IN s_werks.
      ENDIF.                               " IF i_mara[] IS NOT INITIAL
      i_output = i_marc.
      IF i_marc[] IS NOT INITIAL.
        SELECT matnr                       " Material Number
               werks                       " Plants
               lgort                       " Storage Location
          FROM mard
          INTO TABLE i_mard
           FOR ALL ENTRIES IN i_marc
         WHERE matnr EQ i_marc-matnr
           AND werks EQ i_marc-werks
           AND lgort IN s_lgort.
      ENDIF.                               " IF i_mara[] IS NOT INITIAL
    regards
    twinkal

  • How to create an ERD from existing database ?

    hi all
    how i can capture from databse and create an ERD from the whole of database by designer ?
    ssaeeds

    Does a very lousy job at it, as it can create only 1 ERD, one screen big and doesn't save intermediate results.
    Sybrand Bakker
    Senior Oracle DBA

  • How to create a DBlink from oracle database on unix to sqlserver

    Hi
    I need to create a database link from oracle database on solaris machine to sqlserver database.I found that the database link cannot be created from oracledatabase 10g to microsoft sqlserver.So i am planning to go for another windows server where i can pull this data from sqlserver to oracle 10g database on windows and then from windows to unix.
    Can you explain me how can i create a database link from orace 10g on windows to sqlserver.

    HI
    Thanks for your response.
    But the thing is i am looking whether if u can create a database link from oracle to sqlserver from unix.If that's the case what is the driver i require and if not how can i do it ?
    I am ready to create a intermediate windows server where i can pull the table temporarily and then from there to unix box.
    If i can do it windows how can i achieve that.
    Thanks

  • How to  create a datasource from a pool table ?

    Hi guys,
    Is there anyone who faced the same problem.
    I need to create an datasource from the table TIV5T to get texts in BW .
    This table is a pool table . When i want to create the DS in RSO2 i got the message :
    Only transparent tables and database views can be extracted
    I try to create a  projection vue, or use the standard vue  : same error.
    Any Idea ??
    Thank you .
    Dinah

    Hi DInah,
    Please go through the following threads.
    Re: How to extract data from a pool table?
    Datasource on Pool Table
    Regards,
    Ravikanth

  • How do I copy recordsets from one database table to another?

    I am using the Database Connectivity Toolset, and would like to copy either one recordset or multiple recordsets from one Access table to a table in a different database. I would like to do it directly with the data in variant form, but I can't get it to work. I can get it to work(on a small test table) if I first convert my source variant data to a cluster, then insert that into the other database table. My real database has many items with a variety of date types. Can I copy directly variant to variant?

    Is it necessary to read all the data back into LabVIEW first? The reason I'm asking is that it is much more efficient to just use SQL statements to get the data you need and write that directly to the second database. I did a quick Google search on it and came up with lots of responses on what the correct syntax is for setting that up. Using an SQL command to copy the data back and forth is analogous to copying data from one file to another using the Copy file function rather than reading the entire contents of the file, converting the file string to the data arrays, converting back to a string, and then writing it back to another file.
    Chapter 5 of the Database Connectivity Toolset User Manual describes how to execute SQL queries.
    If you do need to actually
    see the data in LabVIEW first, then the only way to get it back into the other database is to convert those variants to LV datatypes and then cluster those values again and write them back out to the second database.

  • How to create mass entries in a database table

    Hi,
    I am going to do a program that can help me to charge registers in a database table. The origin of the registers is an excell file, that contains 39000 entries.
    In other programs I use this function: 'ALSM_EXCEL_TO_INTERNAL_TABLE' but this function can only read 9999 registers. So I ask for us if There is another function that can help me. The other possibility that I think is call many times this function but If is possible to find another function, I guess that is better.
    Thanks and regards.

    Please allow me to translate "charge registers" into "create entries".
    This function module works quite simple via the clipboard, you could take the code and create your own version that allows more rows. However there might be a bottleneck at some point due to your local PC power.
    You could also store as CSV or TXT and use GUI_UPLOAD function or the "frontend" classes.
    For more performant processing the data would need to be transferred to the application server and uploaded from there using OPEN DATASET and so on, please search for more information.
    Thomas

  • How to create XMLTYPE View from the XMLType table

    Hi:
    I have a large XML file and inserted to the XMLTYPE table
    For the XQUERY purpose I would like to create XMLView of the table.
    The examples I got from Oracle to create XML view are for small files.
    Can some one help me how to create XMLType VIEW for large XML Files ( 20,000 lines )?
    Ali_2

    Have a look at the examples given on XMLType Views (based on relational tables) or standard views (based on XMLType storage) in the FAQ url located on the main page of this forum site regarding XMLDB.

  • How to create dynamic tree from db resultset?

    i have a db and sql that includes item_id, parent_id, level, description for all hierarchy.
    i want to show this resultset on the page as a adf tree component. How to convert from db resultset to adf tree?
    that is my sql ->SELECT LEVEL, display_title, item_id, parent_id, sac_Hierarchy.Branch(level,description) branch FROM XXXTABLE CONNECT BY job_code = 'ABCD' AND PRIOR item_id = parent_id START WITH job_code = 'ABCD' AND parent_id IS NULL;
    What can i do on backing java or what can i do on jsp page?
    Help Please.
    thanks
    Edited by: Mehmet Özkan on Aug 30, 2008 12:19 PM

    mehmet,
    Have you seen [url http://technology.amis.nl/blog/?p=2116]this?
    John

  • How to create a user in SQL database table for FBA in SharePoint 2013

    Hi,
    I am trying to configure Form Based Authentication on my SharePoint Dev machine. The purpose is to add an external user to a table (using a registration page).The provider used is SQLMembershipProvider.The dev machine is also configured as domain controller
    so all users created locally are AD users.
    Reference articles that i checked are
    Either adding users to the database as a windows user (i.e. under users section in the database). But on my machine, windows user would be same as adding a AD user.
    Or by creating a dedicated IIS site for .Net users (after creating a FBA DB using aspnet_sql tool). Right now i have implemented FBA using this method.
    Is it possible to add user details in a table of choice and then access that user using people picker? (without any third party tools).
    Thanks,
    Thomas

    Hi,
    We can use CreateUserWizard control to achieve it.
    Here is a blog for your reference:
    Adding Users With SharePoint Forms Based Authentication
    http://psterpe.wordpress.com/2009/05/24/adding-users-with-sharepoint-forms-based-authentication/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to create dynamic tree based on BAPI

    Hi
    I am able to create dynamic tree based on flat file structure example given in SDN . But how to create the tree from BAPI directly.Also when I will be clicking on any leaf node of the tree some data related to the node will be passed to another view.
    Regards
    Ananda

    What i'm trying to do is create an organizational structure.
    Global>Region>Plant-->Corporation
    The output from the RFC is a structure containing every possible combination for orgazational hierarchy. Basically a flat table with record for every possible combinaton of Region-Plant-Corporation. This data needs to be bound to a tree structure so that we can call BW queries based on that level. For example: Give me aged inventory for the SAP corporation within the plant Berlin that is located in the Europe region.
    Now that you understand the business reason will the nodes that represent Region and Plant and corporation be non-singleton nodes or recursive? I was thinking a hierarchy of non-singleton nodes.
    I can bind these nodes to the Region - Plant - Corporation elements returned from in the flat table structure. I will probably get duplicates as a specific Region will be listed multiple times for every possible combination of the data beneath it. I'm not so concerned about that right now as I want to make sure I understand how in Web Dynpro to bind the data to the tree.
    Hopefully this makes some sense. Can you elaborate on how this may be constructed in context of the view?
    Would i create a model node for region (0..n), model node for plant (0..n), and a model node for Corporation (0..n)?
    Or does this sound totally incorrect?
    julian
    We have 3 regions over 50 plants and probably around 500 corporations.

  • Fetch data from different database tables

    Hi...
    How can i fetch data from different database tables and put it into a internal table and then display it??? Can provide simple short codes as i'm new to ABAP. Thanks.

    Hi,
    Check this sample code..
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
            vbeln TYPE vbeln,
            expand,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
            vbeln TYPE vbeln,
            posnr TYPE posnr,
            matnr TYPE matnr,
            netpr TYPE netpr,
          END OF itab1.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'POSNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'POSNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'MATNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'NETPR'.
    s_fieldcatalog-do_sum    = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    DATA: s_layout TYPE slis_layout_alv.
    s_layout-subtotals_text            = 'SUBTOTAL TEXT'.
    s_layout-key_hotspot = 'X'.
    s_layout-expand_fieldname = 'EXPAND'.
    SELECT vbeln UP TO 100 ROWS
           FROM
           vbak
           INTO TABLE itab.
    IF NOT itab[] IS INITIAL.
      SELECT vbeln posnr matnr netpr
             FROM vbap
             INTO TABLE itab1
             FOR ALL ENTRIES IN itab
             WHERE vbeln = itab-vbeln.
    ENDIF.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    DATA: s_keyinfo TYPE slis_keyinfo_alv.
    s_keyinfo-header01 = 'VBELN'.
    s_keyinfo-item01   = 'VBELN'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
         EXPORTING
              i_callback_program = v_repid
              is_layout          = s_layout
              it_fieldcat        = t_fieldcatalog
              i_tabname_header   = 'ITAB'
              i_tabname_item     = 'ITAB1'
              is_keyinfo         = s_keyinfo
         TABLES
              t_outtab_header    = itab
              t_outtab_item      = itab1
         EXCEPTIONS
              program_error      = 1
              OTHERS             = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks
    Naren

  • 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...........

  • What's the best way to create XML file with a schema from a database table?

    Hi,
    I want to create an XML file from a database table (which has over 600 columns) using XML schema (.xsd file). I want to know the best way to do this.
    The output XML file is NOT a direct data dump from the DB table, there�re some logic around it, such as the XML file has some hierarchy with repeating tags.
    I have done this using JAXB by creating Java classes form XML schema, but I don�t want to map 600 DB columns to these Java classes manually, and loop through the record set to create repeating tags.
    I know there are few tools around now like MapForce (Altova), how do people do these now?
    Thanks,
    Chandi

    Can you use a schema when we compose XML doc from Database tables?
    Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me.

Maybe you are looking for