Determining a Receiver Dynamically
You can define that the receiver of a message is determined dynamically at runtime by a mapping program. Instead of creating the receivers in the receiver determination manually, you assign a mapping to the receiver determination and this returns a list of receivers at runtime.
A typical usage case is if you do not yet know the names of the receivers at configuration time. In this case, you can define a mapping program, for example, which reads a list of receivers from a table or from the payload of the message at runtime.
In the standard case (manual entry of receiver), you can of course also formulate conditions that relate to the content of the message. However, you have to specify the names of the receivers to which the message is sent under the formulated condition explicitly in the receiver determination. If you define that the receiver of the message is to be determined dynamically at runtime by a mapping program, you do not need to commit to any specific receiver names at this stage.
During the definition of the interface mapping, you assign the abstract service interface ReceiverDetermination as the target interface. The service interface ReceiverDetermination is in the Enterprise Services Repository in the software component SAP BASIS (namespace http://sap.com/xi/XI/System).
The service interface uses the message type Receivers and the data type Receivers. The data type Receivers describes a list of receivers and has the following structure:
The following instance of the data type Receivers contains two receivers. The first receiver comprises a party (element Party) and communication component (element Service) and is identified by a DUNS number; the second receiver comprises a communication component without a party.
<Receivers>
<Receiver>
<Party agency=“016“ scheme=“DUNS“>123456789</Party>
<Service>MyService</Service>
</Receiver>
<Receiver>
<Party agency=“http://sap.com/xi/XI“ scheme=“XIParty“></Party>
<Service>ABC_200</Service>
</Receiver>
</Receivers>
You can specify party and communication component for each receiver.
...
1. Enterprise Services Repository: Define the interface mapping. Assign the service interface ReceiverDetermination as the target interface (see above).
2. Enterprise Services Repository: Define the message mapping or mapping program that is to determine the receivers at runtime. Assign the message mapping or mapping program to the interface mapping.
3. Integration Directory:
Perform the following steps.
a. When you define the receiver determination, choose the Advanced option.
b. Enter the outbound interface of the interface mapping from step 1 in the key of the receiver determination as the outbound interface.
c. Assign the interface mapping created in step 1 to the receiver determination.