Ansicht
Dokumentation

SAPLCNT4 - Tree Control

SAPLCNT4 - Tree Control

Vendor Master (General Section)   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

Important notes

  • For new developments, use the ABAP Objects wrapper of the tree control, not this function group.
  • The exceptions of the tree control function modules do not set a message.
  • You must not, under any circumstances, ignore any exceptions that occur in the tree control. If an error occurs, the system stops processing the automation queue. This affects ALL of the controls in an internal session. Once an error has occurred, the internal session may no longer work with controls.
  • The tree control is not intended for displaying lists without a hierarchy, since all of the root nodes have to be transferred to the control. Consequently, lists with large numbers of entries lead to performance problems.

Description

You access the tree control functions using the function modules in function group CNT4.

There are three classes of tree controls:

  • SIMPLE_TREE:
  • You create a simple tree using the function module TREEV_CREATE_SIMPLE_TREE

  • A node consists of a single folder or leaf symbol and a text.

  • Example: program SAPTREX3.

  • COLUMN_TREE:
  • You create a column tree using the function module TREEV_CREATE_COLUMN_TREE

  • The tree control has columns.

  • Nodes consist of a folder/leaf symbol and items.

  • A node can have an item in each column.

  • Example: program SAPTREX1.

  • LIST_TREE:
  • You create a list tree using the function module TREEV_CREATE_LIST_TREE

  • The tree control has no columns.

  • Each node has an unlimited number of items.

  • Each item has an individual length.

  • Example: program SAPTREX2.

Class-dependency of the function modules

Some function modules have a code at the beginning of their short text (for example, C or L). These have the following meanings:

  • (C): You can only use the function module with tree controls of class COLUMN_TREE.
  • (L): You can only use the function module with tree controls of class LIST_TREE.
  • (S): You can only use the function module with tree controls of class SIMPLE_TREE.
  • (C,L): You can use the function module with classes COLUMN_TREE and LIST_TREE.
  • No code: You can use the function module with any class of tree control.

Exception handling

You must handle the exceptions of the function modules. This means that the EXCEPTIONS addition in a function module call must at least contain the general exception OTHERS.

Finding errors

If an error occurs while a control is being processed, the function modules usually trigger a general exception FAILED. This merely indicates that an error has occured in the control at the front end. The error has not necessarily occurred in the tree control - it may have occurred in another control. If, for example, a function module of another control has caused an error in the automation queue but not passed the queue to the front end, a subsequent tree control function module may return an error (FAILED exception). Finding the error falls into two parts:

  • An error occurs in a program and a general exception is triggered.
  • The program is restarted in debugging mode. Choose the "Settings" screenand select "Automation controller: Always process requests synchronously". The tree control function modules will now return more precise information about the cause of the error, if the error was indeed caused by the tree control. For example, the exception NODE_NOT_FOUND may now be triggered instead of the general exception FAILED.

Output

Example






TXBHW - Original Tax Base Amount in Local Currency   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 4859 Date: 20240520 Time: 074018     sap01-206 ( 72 ms )