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
Similar Messages
-
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,
KevinHi 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 -
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 PMHi 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 -
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,
Prabaharanhey Prabaharan,
y don't u check this link once
u may get some idea
Re: ALV tree - change node text
Regards
Naveen -
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 -
Runtime error while i add a node in ALV Tree in oops
i am adding a node to alv tree using oop am passing a work area and when i execute it is going for a dump and it says UC_OBJECTS_NOT_CONVERTIBLE
and the below where it is bold and italic it is where the dump is occuring
METHOD ADD_NODE.
FIELD-SYMBOLS: <TAB1> TYPE standard TABLE,
<wa> type any.
assign mt_outtab->* to <tab1>.
insert line in outtab
DATA: L_INDEX TYPE SY-TABIX.
if is_outtab_line is initial.
create initial line
data l_dref_wa type ref to data.
create data l_dref_wa like line of <tab1>.
assign l_dref_wa->* to <wa>.
l_index = 0.
append <wa> to <Tab1>.
else.
APPEND IS_OUTTAB_LINE TO <TAB1>. endif.
L_INDEX = SY-TABIX.
add node to model
CALL METHOD ME->ADD_MODEL_NODE
EXPORTING
I_RELAT_NODE_KEY = I_RELAT_NODE_KEY
I_RELATIONSHIP = I_RELATIONSHIP
IS_NODE_LAYOUT = IS_NODE_LAYOUT
IT_ITEM_LAYOUT = IT_ITEM_LAYOUT
I_NODE_TEXT = I_NODE_TEXT
I_INDEX_OUTTAB = L_INDEX
IMPORTING
E_NEW_NODE_KEY = E_NEW_NODE_KEY.
ENDMETHOD.HI Mohsin,
please refer to the below ....
might be helpful for u .....
https://scn.sap.com/thread/2050188
http://scn.sap.com/message/6407195
http://r0005001.benxbrain.com/de%28bD1lbiZjPTAwMQ==%29/index.do?onInputProcessing=brai_thread&001_thread_id=1759814%20&001_temp=R3TR|PROG|RCSBI010||P01|
Hope thiw will help ....
Regards,
AKS -
Program to add node / delete node in the tree control via abap object
Hi all,
i am new to abap objects.
Can anyone help me out to give program about add node , delete node at
a particular point in tree hierarchy.
folder1 -- level 1
subfolder1 -- level 2
*********subfolder1 -- level 3
*********subfolder2 -- level 3
subfolder2 -- level 2
folder2 -- level 1
if i select level3 and click on ADD button .....i get a facility to add new node
at level 3 and and same thing can happen at level1 and level2 ............ if i select
and folder at level3 and click on delete button ....it should delete that folder...
if you do not have such program ........then guide me how to achieve this target via object oriented because i have to split the screen also and have to show some alve display in that.
just guide me how to add and delete node at a particular level in tree structure....
thanks in advance........Hello Ravi,
Try this demo program:
<b>BCALV_TREE_01</b>
<b>BCALV_TREE_DEMO</b>
BCALV_TREE_SIMPLE_DEMO
Also try:
BCALV_TREE_02
BCALV_TREE_03
BCALV_TREE_04
BCALV_TREE_05
BCALV_TREE_06
regards,
Beejal
**reward if this helps -
Hi All,
I have this requirement.
On ALV Tree node, when user places cursor then i should display some text as quick info.
while create node i have used ICON <- left arrow, i cannot use other ICOn as functional person need this icon only.
During Add_Node, if I pass icon through node layout then its showing nothing, Instead if I pass icon through item layout, then its showing SAP standard ICON text left arrow , but i need custom text write text there.
I tried using Context_menu_req as well, even that didnt worked. Any ideas/views will be highly appreciated.
Thanks n RegardsHi Mr A.
You can try the following:
DATA: l_node_text TYPE lvc_value.
DATA: ls_item_layo TYPE lvc_s_layi,
lt_item_layo TYPE lvc_t_layi.
l_node_text = 'UR Text'
ls_item_layo-style = gs_detail-color_code.
ls_item_layo-t_image = gs_detail-icon.
APPEND ls_item_layo TO lt_item_layo.
After the above mentioned statement, you may call 'Add Node' method of ALV Tree.
Regards
Waz -
hi all
i have a self join table with following column as select statement
SELECT 1, LEVEL, a.product, ''exit'',a.techno
FROM bom_products a
CONNECT BY PRIOR a.techno = a.set_techno
START WITH a.set_techno IS NULL
that techno is pk
and set_techno is fk
and use
following code for view my tree:
DECLARE
htree ITEM;
b NUMBER;
a RECORDGROUP;
BEGIN
go_block('BLK_CHART');
htree := FIND_ITEM('BLK_CHART.T');
a := FIND_GROUP('a');
IF NOT ID_NULL(a) THEN
DELETE_GROUP(a);
END IF;
a := CREATE_GROUP_FROM_QUERY('a',
'SELECT 1, LEVEL, a.product, ''exit'',a.techno
FROM bom_products a
CONNECT BY PRIOR a.techno = a.set_techno
START WITH a.set_techno IS NULL and a.techno='''||:BLK.TECHNO||''''
b := POPULATE_GROUP(a);
FTREE.SET_TREE_PROPERTY(htree, FTREE.RECORD_GROUP, a);
END;
and no problem,
my issue is :
add child to my tree and record to my table
can any one help me to add node???????????????????WRITE THE FOLLOWING SCRIPT IN THE WHEN-BUTTON-PRESSED
INSERT INTO TABLE VALUES (NEW_DISPLAY_LABEL,NEW_VALUE);
COMMIT;
P_PARENT_NODE_VALUE:= ftree.get_tree_node_property('tree4',:system.trigger_node,ftree.node_value);
P_PARENT_NODE := Ftree.Find_Tree_Node('tree4',P_PARENT_NODE_VALUE,Ftree.FIND_NEXT, Ftree.NODE_value, Ftree.ROOT_NODE, Ftree.ROOT_NODE);
P_NEW_NODE := ftree.add_tree_node('tree4',P_PARENT_NODE,ftree.parent_offset,ftree.last_child,ftree.expanded_node,NEW_DISPLAY_LABEL,null,NEW_VALUE);
Message was edited by:
zakaoullah -
Editing a single cell at node level in Alv tree
Hi ,
I am a beginner in ALV tree.Can u please let me know if its possible to edit a single cell at the node level ?
Thanks in advance.
ArchnaCheck the Standard Program may it helpful BCALV_TREE_ITEMLAYOUT.
Kanagaraja L -
Get Node Key Multiple Items Selected from ALV tree
Hello Experts,
I'm having a problem in getting Node keys for the items displayed as ALV tree.
I'm able to get Node key, when only ONE record (Item) is selected.
But, when I select multiple items under a Single node am not able to read(get) the node keys for all the selected items.
I'm using the classCL_GUI_ALV_TREE.
I have tried using the method GET_CHECKED_ITEMS, but not getting the keys.
method GET_SELECTED_ITEM is giving node for a single item. I need it for multiple items selected.
Thank you for your time.
-SANGARHi,
You need to use checkbox concept. and use method GET_CHECKED_ITEMS get selected items
please check this tread.
CL_GUI_ALV_TREE and Checkboxes
aRs -
Macking button to expand the tree and collapse tree and another to add node
macking button to expand the tree and collapse tree and another to add node and saving the changes in the database ( this is problem)
and finally delete node from database
so what is proper code for those buttons
thanks my mail is :
[email protected]Hello,
Use the ftree package's functions
code to expand all nodes:
PROCEDURE explose_tree IS
node ftree.node;
htree ITEM;
state varchar2(30);
BEGIN
-- search the tree ID --
htree := Find_Item('BL_TREE.TREE_1');
-- search the root --
node := Ftree.Find_Tree_Node(htree, '');
-- expand all nodes --
WHILE NOT Ftree.ID_NULL(node) LOOP
state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
IF state = Ftree.COLLAPSED_NODE THEN
Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.EXPANDED_NODE);
END IF;
node := Ftree.Find_Tree_Node(htree, '', ftree.find_NEXT,Ftree.NODE_LABEL,'', node);
END LOOP;
END;and to collapse all nodes:
PROCEDURE Implose_tree IS
node ftree.node;
htree ITEM;
state varchar2(30);
BEGIN
-- search the root ID --
htree := Find_Item('BL_TREE.TREE_1');
-- search the root --
node := Ftree.Find_Tree_Node(htree, '');
-- Collapse all nodes --
WHILE NOT ftree.ID_NULL(node) LOOP
state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
IF state = Ftree.EXPANDED_NODE THEN
Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.COLLAPSED_NODE);
END IF;
node := Ftree.Find_Tree_Node(htree, '', Ftree.FIND_NEXT,Ftree.NODE_LABEL, '', node);
END LOOP;
END; Francois -
ALV Tree - how to put checkbox on the node level?
Hello everyone!
I have an AlvTree and I have special column named SEL. That column contains checkboxes. I want to put additional checkboxes at the node level, I need them to create select all option.
In other words I must somehow create something similar to do_sum option. DO_SUM works for numeric columns, the sum of all rows in current node appears at the top level. So I must do the same but checkbox.
Are there any ideas?
Here is my code of creating the tree.
DATA: g_tree9001 type ref to cl_gui_alv_tree_simple.
" Here I fill fieldcat...
create object g_tree9001
EXPORTING
i_parent = g_doc_cont
i_node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
i_item_selection = 'X'
i_no_html_header = 'X'
i_no_toolbar = ''.
call method g_tree9001->set_table_for_first_display
EXPORTING
i_save = 'A'
is_variant = ls_variant
CHANGING
it_sort = gt_sort9001
it_outtab = gt_tree9001
it_fieldcatalog = gt_treefcat9001.
My output table gt_tree9001 has sthe following structure:
BUKRS, KTEXT, SEL, SWERK.
My sort table gt_sort9001 has 2 rows. Sorting by BUKRS and KTEXT.
My tree looks like this:
BUKRS/KTEXT --- SEL --- SWERK
+bukrs1 ------------------------------
-- ktext1 --- X --- swerk1
-- ktext2 --- X --- swerk2
+bukrs2 ------------------------------
-- ktext3 --- X --- swerk3
I want to get:
BUKRS/KTEXT --- SEL --- SWERK
+bukrs1 ----------X----------------
-- ktext1 --- X --- swerk1
-- ktext2 --- X --- swerk2
+bukrs2 ----------X----------------
-- ktext3 --- X --- swerk3
Appreciate any help!Hi ,
Check the below threads, it may give some idea to get check box in the node .
[LINK1|Check box on left navigation of ALV tree;
[LINK2|Checkbox ALV Tree CL_GUI_ALV_TREE;
Regards,
Saravana.S -
Suppressing empty nodes in ALV tree grid
Hi, I'm writing an ALV tree report with financial data broken down by cost element hierarchy. We've determined that the maximum number of levels in our hierarchy is seven so have to build the program to accept seven node levels. Most times when it runs it will find fewer than seven nodes. Is there an easy to to suppress empty columns in the report so that the end user does not not see a bunch of empty nodes in the report?
Expand or Collapse Branches or Hide Areas
You are able to expand and collapse the branches of the tree structure individually or together. Beyond that you are able to make a node or an item completely invisible.
Methods
Function Class Method
Expand individual branch CL_SALV_NODE EXPAND
Collapse individual branch COLLAPSE
Expand all branches CL_SALV_NODES EXPAND_ALL
Collapse all branches COLLAPSE_ALL
Change visibility of a node CL_SALV_NODE SET_VISIBLE
Check whether the node is visible IS_VISIBLE
Change visibility of an item CL_SALV_ITEM SET_VISIBLE
Check whether the item is visible IS_VISIBLE
Maybe you are looking for
-
TAX condtion is manual and with Cal type is 'B' fixed amt
Hello Team, I am new to SCN, Need Help on below issue, Requirement : In my Client Process, Only Tax value (manually condition maintained) need to settle to the customer It is like a Credit memo and Debit memo Process. (NO delivery and PGI). Reason :
-
Not able to Install Captivate 5.5 on Windows 7 - 64 bit
HI All I am trying to install trial version of Captivate 5.5 on Windows 7 64 bit, but continuously getting following error messages : Exit Code: 7 -------------------------------------- Summary -------------------------------------- - 1 fatal error
-
Adobe PrPro has stopped working
Asus p8h67m-pro core I5-2500k three std hard drive 250,250 320GB one 60GB SSD that has been alloted some page space running win7 64bit sp1 I had PP cd5.552 loaded and working fine once had to reload OS a number of times till I arrived at the memory f
-
SAP PI 7.0 SAML v1.1
Hi, We need to develop a Web Service Receiver with SAP PI 7.0 and add a SAML v1.1 header in the SOAP request. How can we do it in SAP PI 7.0? Is it compatible with this PI version? Thanks in advance, Joan
-
Mac OS X 10.9.5. Current model iMac: 3.5GHh i7. 32GB main mem. NVDIA GeForce GTX 780M 4096MB. Runs fine without a second monitor. Sleep, both manual and timeout, works fine. Press any key awakes. Plug in a second monitor (2 month old 27" Thunde