Skip to Content
0
Former Member
Aug 13, 2016 at 09:57 AM

ALV tree with events

805 Views

I need to develop a screen like output of WE02 screen. left side there will be table name as node. when clicking the table table name the corresponding table data need to be displayed on the right. Please suggest me some easy way to do this.

i also saw the examples with sflight but the output is as table.. i want only the name of the table as node on the left hand side displayed with folder icon.

i learnt and did some basic code but its not as expected. Please guide me through each step.

IF ANY VERY BASIC CODE THAT SATISFIES MY REQ IS VERY APPRECIATED.

here is my basic code

types: begin of ty,

tablename type dd03l-tabname,

end of ty.

data : it type standard table of ty,

wa type ty,

dcontainer type ref to cl_gui_docking_container,

tree type ref to cl_gui_alv_tree.

START-OF-SELECTION.

END-OF-SELECTION.

call screen 100. ( in screen 100 i defined only container)

module pbo_output.

here i just filled my internal table with table name and filled the fieldcats ( IT will have only MARA,MARC as values with single column)

*******

Next i created the docking container object with dock at left (since i want my tree to be displayed on the left)

Next i created Tree object with parent as the above created docking object.

Next i called the function module Tree->set_table_for_first_display to display.

next i looped into my internal table.

i called tree->add_node ( I know that this will add nodes. but how can i insert a node as root node ? )

Endloop.

The output of this is im getting the tree in left. but the nodes are not displayed as node (with folder) its seems like leaf nodes. and my output has more columns with empty spaces.. how can i get rid of those ?

how to register events ?

how can i display the corresponding values on the right.. do i need to define a table control in screen element ?

Please guide me through.

Sorry that i cant paste my code..

Thanks in advance. all helps will be rewarded.