Skip to Content

ALV Tree level of leaf

When I construct dinamicaly ALV Tree i want to know on which level I am.

base lvl

|- item1 of level1

|- item2 of level1

|- item1 of level2

|- item2 of level2

|- item3 of level1

|- item3 of level2

|- item4 of level2

|- item1 of level3

|- item2 of level3

and so on...

I cant find any property wchich describe in cl_gui_alv_tree how deep I'm in this tree, in which level I'm at this moment.

I decided to write own method "get_level" (recurency method), which check if current node is top node when not add to counter, when yes return this counter which represents current level.

It is important for me because, when I expand current node I create different elements which depends on level od node.

Did I get good way to solve my problem?

I reward in poinst for any help.

Cheers. Tomek

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 10:33 AM

    Hi Tomasz,

    Refer standard SAP programs. Hope you get your solution.

    BCALV_TREE_01

    BCALV_TREE_02

    BCALV_TREE_03

    BCALV_TREE_04

    BCALV_TREE_05

    BCALV_TREE_06

    BCALV_TREE_DEMO

    Manish

    BCALV_TREE_DND

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 10:46 AM

    Hi

    Please check the class <b>CL_GUI_LIST_TREE</b>

    this contains several methods as regarding the nodes.

    as for the level i think that you can maybe describe it in the name of the node.ie node-node_key.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Tomasz Suchanek

      Hi Tomasz

      I guess you were retreiving these details for expanding the nodes at a later stage.

      What i have done was whenever i create a parent node, i store this in an internal table i.e node key. Later we can pass these node keys for expansion. Please try the same way orelse can provide you sample code when i get back to office tomorrow.

      Kind Regards

      Eswar

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.