Start of Content Area

Procedure documentation Define a Condition  Locate the document in its SAP Library structure

Use

You can define conditions at various points in the process editor to control processing depending on the result of the condition. At these points, for example, during the definition of a switch, the system automatically displays the condition editor.

You can insert comments to ensure that conditions remain clear and easy to understand. You can also display a where-used list for the expressions used.

Expressions

You can use the following expressions in conditions:

      Container element In a condition, you can use all container elements that are visible for a condition. However, you cannot assign one container element to another.

      Alias: To use an XPath expression in a condition, define an alias and assign the corresponding XPath expression. You can also define alias names for container elements to make conditions easier to read. You cannot assign one alias to another in a binding.

      Constant: You enter constants directly in the condition. You can also give a constant an alias name to make the condition easier to read.

      Context object: You can use context objects directly in a condition.

      Index expression: You use an index expression to specify which element of a multiline container element you want to access. You can specify the index as a constant or as a container element that is determined dynamically.

Relational Operators

The following table shows the available relational operators:

Operator

Meaning

Remarks

This graphic is explained in the accompanying text

Equals

 

!=

Does not equal

 

This graphic is explained in the accompanying text

Less than

 

This graphic is explained in the accompanying text

Less than or equal to

 

This graphic is explained in the accompanying text

Greater than

 

This graphic is explained in the accompanying text

Greater than or equal to

 

CP

Matches pattern

c1 matches pattern c2

To specify pattern c2, you can use normal characters and the following wildcard characters:

* (asterisk) for any string

+ (plus sign) for any single character

NP

Does not match pattern

c1 does not match c2

c1 NP c2 is equivalent to NOT (c1 CP c2)

CE

Table contains element

c1 contains c2

The multiline element (multiline expression) c1 contains c2.

NE

Table does not contain element

c1 does not contain c2

The multiline element (multiline expression) c1 does not contain c2.

EX

Object/element exists

Element is in container or referenced element exists

NX

Object/element does not exist

Element is not in container or referenced element does not exist

Logical Operators

Operator

Meaning

Remarks

&

And

Binds more strongly than |, but less than !

|

Or

Binds less strongly than  & and !

!

Not

Binds more strongly than  & and |

! must be followed by a parenthesis ( ).

The operator relates to the whole parenthesis.

The following conditions mean the same:

      A | B & C | D

      A | (B & C) | D

Procedure

       1.      Check whether all required condition variables are available.

The Condition Variables screen area contains all container elements that are visible for the condition: container elements of the same block, the parent block, or the process container. 

Define Alias for X Path Expressions

You can define additional alias names, which are only valid within the condition. You have to define such an alias name if you want to use an XPath expression in a condition.

       2.      Define the alias name in the Condition Variables screen area.  

       3.      Define the binding for the alias in the Binding screen area. To do this, use the expression editor.

See: Using the Expression Editor

Using Context Objects

If corresponding context objects are defined, you can use these directly in a condition. The Context Objects screen area displays all messages for which context objects are defined.

       4.      Insert the context object at the required position in the condition.

A context object is displayed as follows in a condition:

<Container element>.<Namespace prefix>:<Context object name>

<Containerelement>: Container element that references the message for which the context object is defined.

<Namespace prefix>: Abbreviation for the namespace. The system assigns this abbreviation automatically. To display the full name, choose Namespace Prefix in the menu of the Context Objects screen area. You can also define your own abbreviations.

Access Multiline Container Elements

       5.      To access a particular element of a multiline container element, specify the relevant index expression using the following syntax:

       Index as constant: multiple_containerelement[n]

Accesses the n-th element of the multiline container element. n is a constant of type xsd:integer.

       Index as container element: multiple_containerelement [index_containerelement]

Accesses the lines of the multiline container element that index_containerelement delivers. index_containerelement is a container element of type xsd:integer.

Define a Condition

       6.      To define a condition, specify the required expressions and operators.

You can enter operators, condition variables, and context objects by using the keyboard, or drag them to the correct position by using the mouse.

To display input help, press Ctrl + Space. Input help displays all the elements that you can insert in the condition in the current cursor position.

The condition editor automatically checks the syntax of the condition and displays any error messages and information about correcting errors in the lower screen area on the left. You can also start the syntax check manually, if required.

 

End of Content Area