Hi Rama,
go through this link you can get how to display data in a tree view..
http://www.sapcrmwebui.com/2013/06/63tree-view.html
there is a method GET_CHILDREN here you will get the collection and set the collection..
go to standard component GS_CM/DocTree here there is a method REFRESH under context node1 this will gives the root information and then go to get_children method this will give the next level collection..
read the above doc and observe the standard component you will get how to get the data..
Regards,
Srinivas.