Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Tree

Former Member
0 Kudos

hi

i m new to ALV Tree can any one help in learning this.......

thnx

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi neha,

1. Its quite simple.

2. Basically there are TWO FMs,

which do the job.

3. just copy paste in new program

and u will know the whole logic.

4.

REPORT abc.

DATA : tr LIKE TABLE OF snodetext WITH HEADER LINE.

*----


data

tr-id = '1'.

tr-tlevel = 1.

tr-name = 'amit'.

APPEND tr.

tr-id = '2'.

tr-tlevel = 2.

tr-name = 'mittal'.

APPEND tr.

tr-id = '3'.

tr-tlevel = 2.

tr-name = 'Hello'.

APPEND tr.

tr-id = '4'.

tr-tlevel = 2.

tr-name = 'Brother'.

APPEND tr.

tr-id = '5'.

tr-tlevel = 4.

tr-name = 'Brother'.

APPEND tr.

*----


display

CALL FUNCTION 'RS_TREE_CONSTRUCT'

TABLES

nodetab = tr

EXCEPTIONS

tree_failure = 1

OTHERS = 4.

CALL FUNCTION 'RS_TREE_LIST_DISPLAY'

.

regards,

amit m.

3 REPLIES 3

uwe_schieferstein
Active Contributor
0 Kudos

Hello Neha

You will find various sample reports for all kinds of controls using transaction <b>SE83</b> (Reuse Library). Check the coding of the reports since they contain lots of documentation in the header section.

Regards

Uwe

Former Member
0 Kudos

Hi Neha,

What you need to do is look at the Standard SAP Programs for the same..

It will give insight on all the various functionalities.

e.g

BCALV_TREE_01 ALV tree control: build up the hierarchy tree

BCALV_TREE_02 ALV tree control: event handling

BCALV_TREE_03 ALV tree control: use an own context menu

BCALV_TREE_04 ALV tree control: add a button to the toolbar

BCALV_TREE_05 ALV tree control: add a menu to the toolbar

BCALV_TREE_06 ALV tree control: Icon column and icon for nodes/items

BCALV_TREE_DEMO Demo for ALV tree control

BCALV_TREE_DND ALV tree control: Drag & Drop within a hierarchy tree

BCALV_TREE_DND_MULTIPLE ALV tree control: Drag & Drop within a hierarchy tree

BCALV_TREE_EVENT_RECEIVER Include BCALV_TREE_EVENT_RECEIVER

BCALV_TREE_EVENT_RECEIVER01

BCALV_TREE_ITEMLAYOUT ALV Tree: Change Item Layouts at Runtime

BCALV_TREE_MOVE_NODE_TEST Demo for ALV tree control

BCALV_TREE_SIMPLE_DEMO Program BCALV_TREE_SIMPLE_DEMO

BCALV_TREE_VERIFY Verifier for ALV Tree and Simple ALV Tree

Also please check the transaction <b>DWDM</b> This will give info also on trees.

Hope this helps and happy learning.

Former Member
0 Kudos

Hi neha,

1. Its quite simple.

2. Basically there are TWO FMs,

which do the job.

3. just copy paste in new program

and u will know the whole logic.

4.

REPORT abc.

DATA : tr LIKE TABLE OF snodetext WITH HEADER LINE.

*----


data

tr-id = '1'.

tr-tlevel = 1.

tr-name = 'amit'.

APPEND tr.

tr-id = '2'.

tr-tlevel = 2.

tr-name = 'mittal'.

APPEND tr.

tr-id = '3'.

tr-tlevel = 2.

tr-name = 'Hello'.

APPEND tr.

tr-id = '4'.

tr-tlevel = 2.

tr-name = 'Brother'.

APPEND tr.

tr-id = '5'.

tr-tlevel = 4.

tr-name = 'Brother'.

APPEND tr.

*----


display

CALL FUNCTION 'RS_TREE_CONSTRUCT'

TABLES

nodetab = tr

EXCEPTIONS

tree_failure = 1

OTHERS = 4.

CALL FUNCTION 'RS_TREE_LIST_DISPLAY'

.

regards,

amit m.