Searching in the Simple Tree Model

Use

The Simple Tree Model, unlike the normal Simple Tree Control, allows you to search within the backend version of the tree using the following methods:

To search for

Use the following methods:

Individual nodes

find

find_first

find_next

A set of nodes

find_all

find_all_continue

Prerequisites

You must have created an instance of the Simple Tree Model.

Process

  1. Decide which search method you want to use and call the relevant method of CL_SIMPLE_TREE_MODEL:

    Search method

    Method of CL_SIMPLE_TREE_MODEL

    Find individual nodes with user dialog

    find

    Find individual nodes without a user dialog

    find_first

    Find a set of nodes

    find_all

  2. After the search stops, query the value of the result_type parameter. This tells you whether the search text was found, not found, or if the search stopped because the system encountered a node with the attribute EXPANDER = 'X' and no child nodes.

  3. If the search stopped because of the third case, you can now load the child nodes into the tree model using the add_node or add_nodes method, then restart the search:

    Search method

    Method used to restart the search

    Individual nodes

    find_next

    A set of nodes

    find_all_continue