Skip to Content
0
Former Member
Sep 25, 2007 at 01:32 PM

Populate Tree Structure from BAPI Model Node

23 Views

Hi All,

I need to create a tree structure in a view as a lookup for my profit center. I have a BAPI that will return a table structure that has a parentid and childid relationship

Example Structure

ID   ProfitCtr  ChildID   ParentD
1     ABC            1          0
2     DEF            2           1
3     GHI             3           1
4     IJK              4           2
5     LMN            5           2
6     OPQ            6           3
7     RST             7           3

So I want to display

ABC
  ---- DEF
         ---- IJK
         ---- LMN
  ---- GHI
         ---- OPQ
         ---- RST

How do I create a tree structue from the model node of the context. Do I need to create Value Node/attributes and populate from the model node or can i directly bind the model node to tree structure.

I would appreciate if some one can email me the code sample to

sapnwportal@yahoo.com

Thanks