/BGLOCS/VATREPORT07_MENU - Example:List Tree Control (with Documentation)

Fill RESBD Structure from EBP Component Structure   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Description

This program demonstrates the list tree control (class CL_GUI_LIST_TREE).

Each node in the tree is described by the ABAP Dictionary structure TREEV_NODE. The NODE_KEY field contains the key of the node.
Each node in the tree can posess items, each of which is described by the ABAP Dictionary structureTREEV_ITEM, to which the programmer must add a character field TEXT (of any length). In the exampleprogram, TREEV_ITEM is included in the structure MTREEITM, which, in addition, contains a field TEXT.The NODE_KEY field determines the node to which an item belongs. ITEM_NAME contains the name of the item. This field may only contain integer values from 1 upwards. The items of a node are displayed from left to right.

The example shows some important attributes of the list tree control:

  • Objects" tem: This item has proportional font ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP). Youshould only use proprortional font for an item if the width of the item is automatically adjusted tothe length of the text string (so that the string always fits!). In order to do this, the ALIGNMENT field of the item must contain the value CL_GUI_LIST_TREE=>ALIGN_AUTO.
  • The items in the third and fourth nodes contain a tabular construction. For this to work, the firstthree items of each node must have a fixed length (ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_LEFT, ITEM-LENGTH = ...) and you must use a fixed font for the items. (ITEM-FONT = ITEM_FONT_FIXED).

Selection

Items in a node can be selected individually. When you click the folder or leaf symbol of a node, the entire node is selected.
You can set the selection behavior of the tree so that clicking the node always selects the entire node. To do this, set the ITEM_SELECTION parameter of the constructor method to initial.

Events

The program displays events as they occur on the right-hand side of the screen. The following events can be triggered in the example program:

node_dbl_clk (node double click)

Double click on a node. In the example, this event is triggered when you double-click the folder/leaf symbol. If ITEM_SELECTION is set to SPACE, the event is triggered when you double-click anywhere on a node.

item_dbl_click (item double click)

Double click on an item in a node. This event can only occur if ITEM_SELECTION = 'X'.

expand_nc (expand no children)

You can make a node display a plus sign in its folder symbol even though it has no child nodes (by settingthe EXPANDER field in TREEV_NODE). If the user clicks one of these nodes, the control triggers the eventEXPAND_NC. In the example, the "Program" node has this attribute, and the program reacts to the event by adding two new nodes to the control.

button_click

The user clicked a pushbutton item.

link_click

The user clicked a link item.

Requirements

Output

Example



RFUMSV00 - Advance Return for Tax on Sales/Purchases   General Data in Customer Master  
This documentation is copyright by SAP AG.


Length: 3049 Date: 20120523 Time: 002332     triton ( 157 ms )