10-06-2008 11:01 AM
Hi experts,
I create a simple AVL tree to display the sales order items, just two classes for one relationship. Like the left part on the screen in this program "DEMO_ABAP_OBJECTS_CONTROLS".
I want to let the node of the second class be maintained serial no., somthing like input field behind the node or double click the node, then show up the input field on another space on the same screen.
And there is a button on screen, I can do some check for the text of input field when pressing the button. If the input data is wrong , then show up the error message.
I have searched BCALV* in SE38, but i don't see anything helpful.
Plz give me some advice, thanks a lot!!
Regards,
Claire
10-06-2008 11:15 AM
Have you looked at all the programs with names starting with BCALV_TREE?
10-07-2008 4:59 AM
To Christine,
I just looked the program starting with 'BCALV_TREE' again, but I don't find anything related to input field that I want to create.
Could you plz tell me in which one there is something useful to me?
The following programs:
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_ENABLE_AUTH_CHECK
BCALV_TREE_EVENT_RECEIVER
BCALV_TREE_EVENT_RECEIVER01
BCALV_TREE_SIMPLE_DEMO
BCALV_TREE_VERIFY
Regards,
Claire
10-07-2008 5:10 AM
Hi Claire,
Please check....
call method g_alv_tree->add_node
exporting
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = p_node_text
is_node_layout = l_layout_node
importing
e_new_node_key = p_new_key.
Here if u see the I_NODE_TEXT.... pass any text that you want to display as the text for that particular node....
Regards,
Kunjal
10-07-2008 5:49 AM
Hello Claire
You may have a look at thread
Perhaps you find it useful for your purposes.
Regards
Uwe
10-09-2008 9:57 AM
To Kunjal and Uwe,
My AVL tree is declared like this:
Data: tree TYPE REF TO cl_gui_simple_tree.
The class is not "cl_gui_alv_tree" , so I can not use the code.
The code I create the node is the follwing:
CALL METHOD tree->add_nodes
EXPORTING table_structure_name = 'ABDEMONODE'
node_table = node_table.
And I looked the program that Uwe wrote, the tree is declared in class cl_gui_alv_tree, too.
I want to double click the node and appear a field that can be inputed text.
Is there any other way to do this with the class cl_gui_simple_tree?
Thanks for the advence help.
Claire
10-09-2008 10:28 AM
Hi Claire,
From what you have written, I was able to understand that you want to edit the Node_Text....
1. If that is the case then, I am afraid as we cannot make the ALV_TREE editable...
2. Class you are using cl_gui_simple_tree, that class is having a purpose of creating the tree structure by using simple methods.... In short, they are user friendly as we have to use a few method to create the TREE.... If you go in the constructor, you will be able to see that this class has the same base class of of CL_GUI_ALV_TREE.... Also, if the check the code inside the method that you have used to create the TREE, that method will be using the same methods that is provided by me or in Uwe's example..
Hence, I would suggest you to use the CL_GUI_ALV_TREE for creating the tree. This will simplify all your task that is related to ALV Tree and help you during future enhancement, if require.
Uwe, let us know if you have a different opinion....
Regards,
Kunjal
10-13-2008 11:36 AM
Hi Kunjal,
Thank you for the explanation, I can catch on what you mean.
I am trying to rewrite the code, but I find there is something I am not sure.
The text of the input field that I want to create on the screen is inputted by user's action on the screen, not assigned in the program.
There are two levels in my tree, I want to create the editable fields for the node in the second level.
When double-clicking the node, then disappears a editable field, not the node_text(each node has its text ).
And I can input any string in the field on screen, every node in the second level has its own input field that I can input different string.
Or there is just one edit text in another container on the same screen, when double-clicking the node A, the edit text will be input something by user,
and double-click another node B, the edit text is blank, and go back to double-clicking the node A, the text is still there.
For every node, the edit text is particular and can be always changed.
Sorry about my bad description...
So, can I use the tree declared in class "cl_gui_alv_tree" ?
Thanks anyway! Your help is very useful to me.
Regard,
Claire
10-13-2008 11:49 AM
Hey Claire,
I can get wht you mean. Now here's the answer of your question.
1. ALV Tree does not support editing of data directly.
2. To achieve this you can probably handle the node_click or double_click event..
In the implementation of the method, you can explicitly call a FM that asks the user to enter the node text...(FM Search POPUP_* in SE37).
Get the text entered by the user and edit the required row in the table. When you control is going back to the display.. simple re-create the Tree...
I think this will solve your problem.
Regards,
Kunjal
10-14-2008 7:07 AM
Hi Kunjal,
I understand the solution you suggest, but if there are lots of nodes in my tree,
and the user has to key in the text in the pop-up dialog,
then press the button to return to the tree one by one for each node.
It's not friendly to users, the action repeats a lot of time.
In "VL02N", when packing the delivery items, there is a tree that each node has its input field.
The tree doesn't like GUI AVL TREE, it seems like list output or using ABAP OO.
Do you know that how it works?
I have looked the List of Object Services and Generic Object Services in SAP help, and I can't figure out.
Regards,
Claire
10-14-2008 9:58 AM
10-20-2008 8:49 AM
Thanks a lot!
It's useful to me for the understanding about AVL tree.