Show TOC Start of Content Area

Procedure documentation Branch Expressions  Locate the document in its SAP Library structure

Use

Most likely, each category will have its own category-specific expression corresponding to the different attributes associated with each category.

One approach would be to define a different expression for each category, and then run the expression for the category based on the category value of the records on which you run the expression.

This approach has two shortcomings:

      You can only run expressions on one category of records at a time.

      You have to run the expression for each category separately, one at a time.

Fortunately, MDM offers a shortcut that eliminates both of these problems. A branch expression is the category-specific expression that applies to a particular category value. Each branch expression is defined with respect to a single parent expression.

Collectively, the set of branch expressions corresponding to the set of leaf-node categories allows you to run a single parent expression on a group of records from multiple categories and have it automatically invoke the applicable category-specific expression for each record.

Procedure

...

       1.      In the expressions pane, select the parent expression for which you want to add a branch.

       2.      Right-click on the parent expression and choose Add Branch from the context menu, or choose Records from the main menu and choose Add Branch from the applicable expression submenu.

MDM adds a new expression named parent expression [NULL] to the list of expressions, and highlights it for editing.

       3.      In the Branch property, select the category value for the branch from the drop-down list of categories.

       4.      Define the expression for the branch expression. All the other properties are disabled and read-only.

       5.      To save the branch expression, right-click on the properties pane and choose Save Expression from the context menu, or press Shift+Enter.

MDM names the new branch parent expression [category] and if it is not already part of it, adds the function Branch(Category) to the parent.

Note

To run all of the branches of a parent expression, simply run the parent expression.

Expression branches eliminate complicated expressions that test the category value and then branch accordingly, since the branch automatically runs the applicable category-specific expression based on the value of the category for each record.

End of Content Area