Ansicht
Dokumentation

CMSR_MAP_QUAL_MAP - Beispiel: List Tree Control (With Documentation)

CMSR_MAP_QUAL_MAP - Beispiel: List Tree Control (With Documentation)

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

Description

Report SAPTLIST_TREE_CONTROL_DEMO demonstrates the use of the list tree control (class CL_GUI_LIST_TREE).

One node of the tree is described with dictionary structure TREEV_NODE. The NODE_KEY field contains the node key.
Each node of the tree can own items. An item is described by the dictionary structure TREEV_ITEM, to which the user of the tree control must add the character field TXT (any desired length). In the sample report, TREEV_ITEM is included in structure MTREEITM, in order to insert a field with the name TEXT. The NODE_KEY field dictates to which node an item belongs. The ITEM_NAME field contains the name of this item. Only integers greater than or equal to 1 are allowed. The items in a node are output from left to right.

The example demonstrates some important characteristics of the list tree control, which is explained using some of the items as follows:

  • Item "Objects": This item has proportional font (ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP). The use of a proportional font only makes sense for items if the width of the item is automatically matched to the text string that is received (so that the string alway s fits). To do so, the value CL_GUI_LIST_TREE=>ALIGN_AUTO must be written into the item's ALIGNMENT field.
  • A table structure is created for the items in the nodes that are third and fourth from the top. In this case, it is necessary for the first three items of both nodes to have fixed lengths. (ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_LEFT, ITEM-LENGTH = ...). A fixed font (ITEM-FONT = ITEM_FONT_FIXED) must be used for these items.

Selection

The items of a node can be selected individually. A click on the folder or page symbol of a node selects the entire node.
You can also set the selection behavior of the tree so that one click always selects the entire node (ITEM_SELECTION-Set the parameter for the constructor to initial).

Events

The events that occur appear on the right side of the screen. In the sample program, you can trigger the following events:

node_dbl_clk (node double-click)

A node is double-clicked. In the sample program, you can do so by double-clicking on the folder or page symbol. If ITEM_SELECTION is set to SPACE, this event is triggered if any section of the node is double-clicked.

item_dbl_click (item double-click)

An item in the tree was double-clicked. This event can only occur when ITEM_SELECTION = X.

expand_nc (expand no children)

A node can have the characteristic that it displays a plus symbol (+) for a folder or page, even when there are no lower-level nodes (children). To make this setting, use the expander field in TREEV_NODE. If users click on one of these nodes, the EXPAND_NC event is triggered. In the example, node Program has this characteristic. The sample program reacts to these events by copying two new nodes to the control.

button_click

The user clicked a button.

link_click

The user clicked a link item.

Requirements

Output

Example






Addresses (Business Address Services)   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

Length: 3411 Date: 20240531 Time: 234149     sap01-206 ( 71 ms )