Editing Graphics

Modifying the shape of the hierarchy is sometimes possible. This depends on whether the ABAP program you used to call SAP Hierarchy allows you to modify the hierarchy. (When modifications are not allowed, the Node and Subtree entries in the Edit menu appear in faded text, and you cannot select them.)

Accessing the Editing Functions

If modifications are allowed with your data, you can use the options in the Edit menu to edit a node or a subtree.

First, click once (left mouse button) on the desired hierarchy node to select a point of reference. Then proceed as follows:

  • Select the Node or Subtree option from the Edit menu.
  • Click again (right mouse button) on the selected node.

Selecting Multiple Nodes

For some of the editing functions (the Edit  ®  Subtree functions), you can apply the function to more than one node at a time. You can select multiple nodes if the ABAP program you used to call SAP Hierarchy allows it.

See the section Selecting Hierarchy Nodes for information on selecting multiple nodes at a time.

The Node Editing Options

The following sections describe the node editing options available. You can access these options in by choosing Edit  ®  Node.

The Edit Node Option

This option calls up the Edit Node menu. This menu offers you the following information:

  • Old text name

The current text name for the node. This field is for your information only. You cannot change its value.

  • New text name

The text name you want to appear in the node. To edit this field, simply type in the new name.

  • A list of display attributes for the hierarchy

This list contains the node's numeric value for each attribute. To edit these numeric values, click on the up- or down-arrows until the number shown to the right is the value you want. You can also click on the number itself, delete it, and type in the desired value directly.

The Insert Node Option

When you select the Insert node option, the system calls up the Insert Node menu.

This menu allows you to add new nodes to the hierarchy. You can either insert a node as the child of (underneath) an existing node, or you can start a whole new tree.

This menu offers the following fields:

  • Old ID and Old text name

The node ID and text name for the currently highlighted node. These values appear at the top of the window and cannot be changed. They are for your information only.

  • New ID

The node ID for the node to be added. Type in an identification name for this node. This name is required and must be unique.

  • New text name

The text name for the node to be added. Type in the new name. This name is required, but need not be unique.

  • New tree?

To create a new tree, click once on this option. If you are only inserting a node into the existing tree, don't click on this button at all. New tree? is inactive by default.

If you have clicked on New tree? and want to turn it off again, click on one of the other options (Left sibling?, Right sibling? or Leftmost child?). New tree? becomes de-selected.

If you activate New tree? and confirm it by clicking on Continue, the node you insert becomes a separate hierarchy of one node. It is not attached to the existing tree.

If you don't activate New tree?, the new node becomes a sibling or child of the highlighted node (depending on which of the Left sibling?, Right sibling? or Leftmost child? options is on).

Creating a new tree is useful when you actually want the new node to be the root (topmost node) of the old tree. You can first create the new tree, and then use the Move subtree option to move the main hierarchy over to be the descendants of the new node.

  • Left sibling?

This option inserts the new node to the left of and on the same hierarchy level as the selected node.

  • Leftmost child?

This option inserts the new node as leftmost child of as the selected node. (That is, the new node becomes the first node on the next lower level from the selected node.)

  • Right sibling?

This option inserts the new node to the right of and on the same hierarchy level as the selected node.

  • A list of display attributes for the hierarchy

This list contains the node's numeric value for each attribute. To edit these numeric values, click on the up- or down-arrows until the number shown to the right is the value you want. You can also click on the number itself, delete it, and type in the desired value directly.

The Delete Node Option

This option allows you to delete a node from the hierarchy. The node deleted is the one highlighted at the time you select this option.

All nodes hanging from the node deleted are re-attached to the hierarchy as the children of the deleted node's parent.

For example, suppose the deleted node has three children, and the parent of the deleted node has two children (before deletion). After the deletion, the parent of the deleted node has four children.

Using the Delete node option produces a popup window asking you if you are really sure you want to delete the node and its subtree. You can confirm the request or cancel it.

The Move Node Option

This option allows you to move a node or a subtree from one place to another.

With the Move node option, the currently highlighted node should be the node (or the top node of the subtree) you want to move. After clicking on the option, click on the target node: the node you want as the new parent for the node or subtree you are moving.

The position that your node or subtree takes amongst the children for the new parent depends on the value of the Order of Child Nodes option (in the Display Attributes menu).

The Subtree Editing Options

The following sections describe the node editing options available. You can access these options by choosing Edit  ®  Subtree.

The Hide Subtree(s) Option

This option displays the hierarchy without the subtree hanging from the highlighted node.

The Display Subtree(s) Only Option

This option displays the highlighted node and all its descendants (the subtree hanging from it).

The Delete Subtree Option

This option allows you to delete a subtree from the hierarchy. The subtree includes the node highlighted at the time you select this option.

Using the Delete subtree option produces a popup window asking you if you are really sure you want to delete the node and its subtree. You can confirm the request or cancel it.

The Split Tree Option

This option allows you to cut a subtree out of the hierarchy and create an independent tree with it. When you do this, you get two separate hierarchies at the same time. The node highlighted at the time you selected the Split tree option becomes the "root" (topmost node) in the new tree.