Condition Editor 
If you specified the receiver business systems explicitly, you can specify a condition for forwarding the message to these receivers.
You can specify a condition that refers to fields in the payload of the message. If the specified condition is fulfilled for these fields (the field has a certain value, for example), then the message is forwarded to the specified receiver business systems.

Conditions are specified in the language XPath. The language XPath addresses parts of an XML document. A description of XPath would go beyond the scope of this documentation. See the W3C recommendation from November 16, 1999 (English/German/Other translations).
Three options are available for formulating a routing condition:
· Type: Field value
You can select the contents of a field from the
payload by using an XPath expression and compare them (using the
operators
or
) to a value. At runtime, the current value of
the field in the payload is compared with the value that you have specified in
the Condition Editor.
You can use AND and OR operators to link multiple occurrences of these “equations” to a more complex condition.

In a flight booking Business Scenario, a message contains the field Destination_From for the departure airport of a flight. An example of a possible condition would be: “If the field Destination_From has the value FRA (departure airport: Frankfurt am Main) or JFK (departure airport: Kennedy Airport New York), then the message is forwarded to the business systems that are specified in the column Receivers.” The text in the column Condition would then read: (//Destination_From = FRA) OR (//Destination_From = JFK).
· Type: Logical expression
If you are unable to use the field value method and want to make full use of XPath, you can enter a complex logical expression directly. If this expression is fulfilled, then the message is forwarded to the specified receivers.
· Type: Context
The adapters contain information that may be relevant for routing. In such cases, where IDoc outbound interfaces or RFC outbound interfaces are to be processed, in the routing condition you can specify context objects which you want to use to access this information.
¡ IDoc
This gives you the option of accessing selected fields of the IDoc control record (see Features).
¡ RFC
Here you can specify the name of the RFC destination in the sender system (see Features).
The Condition Editor consists of two tab pages:
This allows you to define the condition. You can enter a separate expression in a table row. You can then use AND and OR operators to combine these expressions to any complex condition.
Functions for Editing Tables
|
Icon |
Function |
|
|
Insert Group: Inserts a new row for a new expression below the selected row. The new expression is linked to the expression in the selected row by the OR operator. |
|
|
Insert Expression: Inserts a new row for a new expression below the selected row. The new expression is linked to the expression in the selected row by the AND operator. |
Expressions that are linked through an AND operator are combined using a parenthesis symbol. The complete condition is displayed below the table in a preview window.
The contents of the individual table columns do not depend on the expression type you have specified in the column Type. You can define the type while in change mode, using the dropdown list box.
Table Columns
|
Column Type |
Column XPath |
Column OP |
Column Value |
|
Field value |
Here you can enter the XPath expression that you want to use to select contents of a payload field (for example: //Airline_Id). |
Choose
between |
Comparison value for the field value in payload that is selected by the expression in column XPath |
|
Logical expression |
Here you can enter a complex logical XPath expression. The entire expression is then compared with the value TRUE (in the column Value). This means: If the expression specified here is true, then the message is forwarded to the specified receivers. |
|
TRUE (The expression specified in column XPath is checked for TRUE.) |
|
Context IDoc |
To identify the IDoc partner, you can access one or more of the following fields of the IDoc control record: RCVPRN, RCVPRT,RCVPFC, SNDPRN, SNDPRT, SNDPFC. Use the following syntax with the IDoc namespace (example for field RCVPRN): urn.sap-com:document:sap:idoc:messages.RCVPRN |
Choose between |
Comparison value for the field value selected in column XPath |
|
Context (RFC) |
Here you must specify the name of the RFC destination of the sender system in the following syntax with the RFC namespace: urn.sap-com:document:sap:rfc:functions.Destination |
Choose between |
|
Functions
|
Icon |
Function |
|
|
Insert a Row Below the Selection: Inserts a new row for a new prefix/namespace pair below the selected row. |
If you
confirm the details you have entered in the Condition Editor by choosing
Copy
, then the
selected condition is saved and Display/Change Routing Condition is
displayed in the Editor in the Condition column.