Use this method to add a node to the List Tree Model. The node is initially only added to the tree model at the backend. It is automatically transferred to the tree display at the frontend at the end of the next PBO event.
CALL METHOD list_model->add_node
EXPORTING node_key = node_key
relative_node_key = relative_node_key
relationship = relationship
isfolder = isfolder
hidden = hidden
disabled = disabled
style = style
no_branch = no_branch
expander = expander
image = image
expanded_image = expanded_image
drag_drop_id = drag_drop_id
last_hitem = last_hitem
user_object = user_object
items_incomplete = items_incomplete
item_table = item_table.
Parameter and Type |
Opt. |
Description |
node_key |
The key by which the node is identified in the tree. This must be unique throughout the tree. You should only use letters, digits, and the underscore character in node keys. | |
relative_node_key |
X |
The key of a node to which the new node is related in position. If the new node is the first or last root node, this parameter must have the value ' ' . |
relationship |
X |
The relationship between the new node and the node specified in relative_node_key . Possible values are:Inserts the new node as the first child node of the node specified in relative_node_key . This must be a folder. Note: If relative_node_key is empty, the new node is inserted as a root node. Where the above values contain the word FIRST or PREV , it is inserted as the first root node. Where they contain LAST or NEXT , it is inserted as the last. |
isfolder |
Specifies whether the new node should be a folder or a leaf. Possible values: | |
hidden |
X |
Specifies whether the node should be hidden ( 'X' ) or visible( ' ' ). Default is visible. |
disabled |
X |
Specifies whether the node can be selected ( ' ' ) or not ( 'X' ). The default is not disabled.Note: If a node is disabled, actions such as double-clicking it have no effect. |
style |
X |
Sets the colors of the text and the background for the node. The possible values for this field are any static constant CL_TREE_MODEL=>STYLE_* . For further details, refer to the definition of CL_TREE_MODEL in the Class Builder. |
no_branch |
X |
Specifies whether connecting lines should be drawn between the nodes ( ' ' ) or not ( 'X' ). The default is for the lines to be drawn. |
expander |
X |
May only be set for a folder. If you set this attribute, the closed folder always displays a '+' symbol, even if it is empty. When the user clicks on the folder, the event EXPAND_NO_CHILDREN is triggered. |
image |
X |
Specifies the image used for the node. Possible values:
|
expanded_image |
X |
Specifies the image used for an open folder. The possible values are the same as those listed above for the image parameter. |
drag_drop_id |
X |
Only relevant if you want the node to be drag and drop-enabled. It contains the handle for a drag and drop object. |
last_hitem |
X |
The name of the last item to appear under the hierarchy heading |
user_object |
X |
Can be assigned any reference to an application object |
items_incomplete |
X |
Flag indicating that the items table is incomplete. In this case, you load the items on demand. For further information, refer to Loading Items on Demand. |
item_table TYPE TREEMLITAB |
Table of items for the node with the line type TREEMLITEM . For further information, refer to the documentation of the structure in the ABAP Dictionary. |