ALV tree - change node text

hello,
on a screen I have input fields such as year and below a container holding an ALV tree.
When I change the year value, that starts a new selection from a table and should result in changing many of the lines in the tree.
I was trying to use the methods "get_outtab_line" to retrieve the tree line data and then changing this data with method "change_node".
The problem is I cannot access the correct node-key. The node-key value is kept in memory somewhere and when I refresh the alv tree at PBO, the node-key is incremented from the stored value which means I cannot use get_outtab_line properly.
Any suggestions or example programs,
Thanks a lot,
Kevin

Hi Kevin,
Try using method update_calculations instead of directly using frontend_update.
So the sequence should be,
  IF NOT ref_tree IS INITIAL.
    CALL METHOD ref_tree->free.
  ENDIF.
  CREATE OBJECT ref_tree...
  CALL METHOD ref_tree->set_table_for_first_display...
****Data fill in a loop
  CALL METHOD ref_tree->add_node..
****Expand if needed
  CALL METHOD ref_tree->expand_node..
****Toolbar Logic if needed..
****Events Registration
****Finally call to update calculations
  CALL METHOD ref_tree->update_calculations..
Hope this helps..
Sri

Similar Messages

  • ALV Tree - Change average value

    Hi all,
    I want to change the average value. For the follow example the hierarchy has 2 lines but it is a summarize of 13 lines. So the right average is (100.00 + 16.67) / 13
    SAP average
    Expectation:
    I am using:
    data: g_tree type ref to cl_gui_alv_tree_simple.
    Is it possible to change it?
    Regards,
    Andréa

    Hi,
    Use CL_GUI_ALV_TREE method for creating the Tree, in that create each node by method ADD_NODE. With this method you can do calculation and update while building the ALV Tree.
    Just refer the Demo program 'BCALV_TREE_DEMO'.
    First get the final output table data.
    Loop that table and create each node by using ADD_NODE method.
    Thanks & Regards
    Bala Krishna

  • Editing of a  Column of ALV Tree(OOPS) node

    is it possible to edit a column of node of ALV tree.
    i am using ALV class "CL_GUI_ALV_TREE".
    After searching existing threads, for the same issue..i found the following.
    1) Editable Tree ALV
      ( displays pop up window where user can change values and then transfer these changes back to ALV tree)
    2) Editable Field in ALV TREE Display Using OOPs
         (this approach is not working for ALV Tree)
    But i want to edit directly coulmn of a node of ALV tree.
    is it possible in  OOPS ALV Tree?
    if it possible, can any one provide the sample code,

    As you already noticed, this is not possible, but you may edit your fields outside the tree and bring your changes back to tree. I struggled with the same once but eventually used described alternative. If you use saplink you may check upgrade [chain and rename|http://code.google.com/p/saplink-chain-and-rename/downloads/list] where this approach is released. The code is free so you will be able to study and copy whatever you need from it.
    Editing in a pop up is also an alternative here.
    Regards
    Marcin

  • ALV Tree, Expanded node do not show data in certain column

    Hi all,
    I need your help regard to below problem.
    I have an ALV grid in which one of the columns has F4 (search help). If search help is called by pressing a F4 button a dialog box will be shown with ALV tree on it.
    The ALV Tree has 2 columns which are: hierarchy column and one other column called WBS column. At the first show, all expanded node show data contained in WBS column, but if I click to expand a collapsed node, data is not shown in WBS column for the new expanded rows, only shows data in hierarchy column. How to show data in WBS column for the new expanded rows..?
    Basically if at the first show I expand all node, data in WBS column are shown for all rows. It seems that the Expand Node event doesn't update all column data to be shown.
    Please share if anyone of you has faced this kind of problem. Thank you.
    Regards,
    Ramses Hutahaean
    Edited by: Ramses Hutahaean on Feb 29, 2012 1:38 PM

    Hi Fenja,
    as the click-events only raise the node_key (at least I couldn't detect another information), I assume the only way is maintaining an internal helper table by yourself which you build up in parallel when creating the tree and its nodes.
    The (hashed) table might contain 2 columns:
    1. node_key (as table key)
    2. reference to an object
    When a click-event is raised, you look up the corresponding object reference in your table.
    Regards,
    Ulrich

  • ALV TREE add node

    can someone please help me ?
    I can't find how the method add_node for a alv tree works:
    CALL METHOD tree->add_node
        EXPORTING
          i_relat_node_key =
          i_relationship   =
          i_node_text      =
          is_outtab_line   =
        IMPORTING
          e_new_node_key   =
    can someone please explain me the meaning of the parameters?
    thanks in advance

    Hi Gabriele,
    Check out the below sample code to use of the method add_node.
    data: l_relat_node_key type lvc_nkey,
             l_node_text type lvc_value,
             ls_node_layout type lvc_s_layn,
             ls_node_key like node_key,
             new_node_key type lvc_nkey.
        call method alv_tree_control->add_node
          exporting i_relat_node_key = l_relat_node_key
                    i_relationship   = cl_gui_column_tree=>relat_last_child
                    i_node_text      = l_node_text
                    is_node_layout   = ls_node_layout
                    is_outtab_line   = ls_tree
          importing e_new_node_key   = new_node_key.
    *   ID und Node_key in Tabelle gt_node_key abspeichern
        ls_node_key-id       = ls_tree-klnodetext-id.
        ls_node_key-node_key = new_node_key.
        append ls_node_key to l_node_key_tbl.
    This might helpful for you.
    Thanks,
    Chidanand

  • Sap Alv Tree Change Cell Icons ?

    How can i change this icons ?
    Thanks & Regards...

    Hello Burak,
    in the node Table you can change image:
    for example:     
         wa_node-n_image   = icon_delete.   "Folder closed
         wa_node-exp_image = icon_delete.  "Folder expanded
    best regards
    Werner

  • Adf:tree change node icons

    Hi ,
    Is it possible to create adf tree like in this example - http://www.roseindia.net/jsf/RCFaces/RCF-tree-component.shtml.
    There is two options for tree defaultExpandedImageURL and defaultImageURL . I need implement such functionality in adf tree
    how can i do it ?
    Thanks in advance.

    with help of : zero linecodes you can achieve this in adf tree.
    so can you please tel the usecase.

  • Drag and Drop between two ALV Tree.

    Hi,
    I am trying the drag and drop event between two ALV Tree.
    After the occurence of drag and drop event , I am able to get the node key of the source tree node which is dragged . But when the node is dropped onto the target ALV Tree the target node does not gets selected, instead a plus mark appears focussing on the target node in the target ALV Tree. Can anyone suggest a way to get the node key of the focussed target node. Thanks.
    Regards,
    Prabaharan

    hey Prabaharan,
    y don't u check this link once
    u may get some idea
    Re: ALV tree - change node text
    Regards
    Naveen

  • Report with ALV tree and ALV list?

    I need to create a report with layout as same as this one
    [http://trangiegie.com/MyFile/output.JPG]
    It looks like a report with combination of ALV tree and list. The tree works like a navigation bar. Wonder if there are any demo programs like this. Will appreciate any help.

    For Tree alone - You can check program : BCALV_TREE_02
    Program Name                   Report title
    BCALV_GRID_DND_TREE            ALV Grid: Drag and Drop with ALV Tree
    BCALV_GRID_DND_TREE_SIMPLE     ALV GRID: Drag and drop with ALV tree (simple)
    BCALV_TEST_COLUMN_TREE         Program BCALV_TEST_COLUMN_TREE
    BCALV_TEST_SIMPLE_TREE         Program BCALV_TEST_SIMPLE_TREE
    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

  • Sample Program for Creating ALV Tree

    Hello Guys,
    Can some One Send me some sample program for creating ALV Tree.
    my Requirement is like below Diagram.
    ALV Tree |   ALV GrId
       |
       |
    I want to also about event in ALV , As per requirement when user select (Double click or press any push button) a node of ALV Tree That Node (Contain Sales order and as a child billing Doc No)  In the ALV Grid All the details about Sales order Will be display.
    Please guide me.
    Thanks
    Swati....

    Hi..
    check the following demo programs:
    RSDEMO_DRAG_DROP_EDIT_TREE
    RSDEMO_DRAG_DROP_TREE_MULTI
    BCALV_GRID_DND_TREE
    BCALV_GRID_DND_TREE_SIMPL
    BCALV_TEST_COLUMN_TREE
    BCALV_TEST_SIMPLE_TREE
    BCALV_TREE_01
    BCALV_TREE_02
    BCALV_TREE_03
    BCALV_TREE_04
    BCALV_TREE_05
    BCALV_TREE_06
    BCALV_TREE_DEMO
    BCALV_TREE_DND
    BCALV_TREE_DND_MULTIPLE
    BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_ITEMLAYOUT
    BCALV_TREE_MOVE_NODE_TEST
    BCALV_TREE_SIMPLE_DEMO
    BCALV_TREE_VERIFY
    hope this helps..
    -kothai

  • How to alter the alv tree node text?

    hi
      i want to alter the alv tree node text, many people say it cann't be changed, but
    i look into the sample code 'BCALV_TREE_04', the average funtion(select a column and then select average function in the tool bar) can alter the tree node text dynamically.
      i try to look into the source code, the it's the sap standard code, all the funtions that user input, it goes to the statement "  CALL METHOD cl_gui_cfw=>dispatch.", and i don't understand what this statement do, can someone helps me?

    hi
    good
    The ALV tree report produces uses OBJECT METHOD functionality in-order to produce a
    tree structured ALV output. 
    The creation of an ALVtree report first requires the creation of a simple program to build the ALV
    details such as the fieldcatalog and to call a screen which will be used to display the ALVTree.
    The screen should be created with a 'custom control' where you wish the ALVtree report to appear.
    For the following example it will have the name 'SCREEN_CONTAINER'.
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
    reward point if helpful.
    thanks
    mrutyun^

  • How to directly change the text of a tree node once its in the tree

    How can I directly change the text of a tree node once its in the tree.
    I have a property box which fires an eventevery time it is edited
    (this is currently just output to the screen via println)
    What i want is for the tree node to take the updated text that is in the text box every time
    thus giving tree labels that update as you type
    PS. i have access to the tree node (DefaultMutableTreeNode) from the code that hanldes
    the text box event

    ... use the setUserObject() method of your DefaultMutableTreeNode, that'll set the text of the node.
    however, you probably need to do a treeModel.nodeChanged(node) with your tree model, to get the display updated.
    thomas

  • Not able to copy the tree node text in solaris, while easily done in window

    Hi,
    I m not able to copy the text present on the tree's node to terminal or other text editor in solaris. I m using <Shift><control> C and V comaand for the same but the text is not being copied and pasted on the text pad or the terminal window.
    While the same is possible in windows OS using ctrl+c and ctrl+v command.
    Please suggest the possible solution for the same, is there any property of the tree/OS needs to be set?

    Help About says I'm on 20.0.1
    Up until last week, I was able to use the tab key when typing emails and other multi-line text boxes.
    Suddenly the behavior of the tab key changed. This isn't the first time. It's been quite a while ago that the function of the tab key changed from indenting to moving around the page, then after some time it changed back to indenting.
    Can we get this fixed and leave it alone, please?
    I may give one of those add-ins a try, but my problem with add-ins is that they break when FF is patched or upgraded, then I'm left with out the solution they provide.
    Can we just fix Firefox, please?
    Thanks,
    Frank
    P.S. Another potential fix I came across suggested starting FF in safe mode to see if the problem goes away. It does not. It seems to be a change to FF that appeared after an update last week. On or just befor 24 Apr.

  • Change toolbar in an alv tree

    Hi,
    I 'm using an alv tree.
    I need to change the toolbar to add an icon in which we have several choices as for example the icon "VARIANT" in wich we have 3 or 4 entries : "Save variant" (&SAVE), "Maintain variant" (&MAINTAIN), ...(&COL0")  --> One icon and several choices
    I'm using the method ADD_BUTTON from Class CL_GUI_TREE.
    Can someone help me ?
    thanks

    Hi Robert
    Hope below code can give you some idea:
    *&      Form  CHANGE_TOOLBAR
    FORM CHANGE_TOOLBAR .
    DATA: TOOLBAR TYPE REF TO CL_GUI_TOOLBAR.
    DATA: IT_BUTTON TYPE TTB_BUTTON.
    CALL METHOD TREE1->GET_TOOLBAR_OBJECT
         IMPORTING
            ER_TOOLBAR = TOOLBAR.
    CHECK NOT TOOLBAR IS INITIAL.
    CALL METHOD TOOLBAR->ADD_BUTTON
         EXPORTING
            FCODE = ' '
            ICON = ' '
            BUTN_TYPE = CNTB_BTYPE_SEP
            TEXT = ' '
            QUICKINFO = 'This is Separator'.
    CALL METHOD TOOLBAR->FILL_BUTTONS_DATA_TABLE
      EXPORTING
        FCODE = 'SUCC'
        ICON = '@5B@'
        BUTN_TYPE = CNTB_BTYPE_GROUP
        TEXT = ' '
        QUICKINFO = 'GREEN'
      CHANGING
        DATA_TABLE = IT_BUTTON.
    CALL METHOD TOOLBAR->FILL_BUTTONS_DATA_TABLE
      EXPORTING
        FCODE = 'STOP'
        ICON = '@5D@'
        BUTN_TYPE = CNTB_BTYPE_GROUP
        TEXT = ' '
        QUICKINFO = 'WAIT'
      CHANGING
        DATA_TABLE = IT_BUTTON.
    CALL METHOD TOOLBAR->FILL_BUTTONS_DATA_TABLE
      EXPORTING
        FCODE = 'ERR'
        ICON = '@5C@'
        BUTN_TYPE = CNTB_BTYPE_GROUP
        TEXT = ' '
        QUICKINFO = 'RED'
      CHANGING
        DATA_TABLE = IT_BUTTON.
    CALL METHOD TOOLBAR->ADD_BUTTON_GROUP
        EXPORTING
          DATA_TABLE = IT_BUTTON.
    ENDFORM.                    " CHANGE_TOOLBAR
    Regards
    Eswar

  • Changing JTree node text results in "..."

    I'm working with a JTree, and I have a problem if I change the text displayed on a node. After changing the node, I call nodeChanged( node ) on the tree model.
    What happens is that if the new text on the node is longer than the previous one, the text is cut short and the end replaced by "...". E.g. if the old text was "foo" and the new is "foobar", it turns out as "foo...". This happens even if there is more than enough space in the tree to hold the complete new name, e.g other nodes in the same column with longer names.
    I guess somehow, the tree doesn't properly correct the layout of the cell to accomodate the longer text. I feel it is a bug, since I use the proper calls on the tree model to notify of the change.

    nodeStructureChanged() will give the exact same behavior.
    A solution is to use SwingUtilities.invokeLater().
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){model.nodeChanged(node);}
        });

Maybe you are looking for

  • How to schedule BW archive job?

    Hi all, I will use Archive Development Kit to archive BW data. But I will not do it mannually by using SARA. Anybody knows how to schedule from non SAP scheduler. BambooShampoo.

  • My music app resets a song when I close the phone the first time and then when i open the phone again.

    Does anybody have the same problem?

  • HOW TO MAP IDOC TO XML

    Hi,   I need to map IDOC to xml but the problem is I have 400 fields in IDOC which  are to be mapped to 20 elements in XML.       As it a tedious process to go to 400 fields for each xml element.Is their any better way to find correct field in IDOC w

  • How to manage and classify iwork files?

    Maybe you can help me. I use a lot of written docs, iWork docs. I am looking for a way to store and classify them. Something like an iTunes for docs, where I can move around, give them tags, different lists etc. At the moment I just have them in diff

  • Cost Center & Company Code Link.

    Hi, All Experts. I am having query, I am posting transactionfor company code 1001 ( USD ), and for CO Object I am taking 1101 Company code cosr center ( CAD ). Still system accpeting this. How ? Ideally it should give error or at least warning messag