Dynamic Extended Receiver Determination SAP PI/PO

Extended or Dynamic Receiver Determination is useful when it comes to determining message receivers at interface runtime by evaluating the content of the sender message using complex logics.

Standard Receiver Determination allows us to find the receivers based on Xpath of the sender message. An only a limited number of operators are allowed to evaluate Xpath element data content. Operators in Standard Receiver Determination are limited to Equal to (=), Not Equal to (≠), Contain Pattern (≈) and Exists (EX).

Therefore, the main advantage of Extended Receiver Determination is that it facilitates complex logic-based receiver evaluation at runtime.

 

The Main Differences Between Standard and Extended Receiver Determination.

Extended Standard
Receivers are determined at runtime of Message Mapping. Receivers are determined by rule based at Design Time.
Complex logics can be build at massage mapping. Rules based on data content of Xpath
Mapping techniques such as UDFs or Java mappings can be used to build complex receiver rules. Rules only allow operators Equal to (=), Not Equal to (≠), Contain Pattern (≈) and Exists (EX).
Parameterized mapping can be used to import additional values required at runtime.
Special SAP BASIS standard data types, message types, interface objects are required.

 

Step by Step Guide on How to Create an Extended Dynamic Receiver Determination in SAP PO 7.5 Single Stack Version.

 

Example Scenario:

I have chosen a simple logic since the main purpose of the article is to show the functionality of the Extended Receiver Determination to avoid creating complex Message Mapping. Let’s assume we have an XML file which sends two integer values (value1 and value2) and if the sum of these two values is greater than 10, message should be send to receiver ‘Test_A’ else to ‘Test_B’.

Sender message xml.

<?xml version="1.0" encoding="UTF-8"?>
<ns0:thirdparty_sender xmlns:ns0="urn:thirdparty.com_FileSystem">
   <root value1="1" value2="2"/>
</ns0:thirdparty_sender>

Let’s base the receiver rule on sum of value1 and value2.

 

Prerequisites:

The objects under software component ‘SAP BASIS’,  namespace ‘http://sap.com/xi/XI/System’ should be available in Enterprise Service Repository (ESR).

  • Data Type: Receivers
  • Message Type: Receivers
  • Service Interface: ReceiverDetermination
Required SAP standard system objects under BASIS software components.
Required SAP standard system objects under BASIS software components.

 

We use data type ‘Receivers’ to populate the list of dynamic receivers determined at runtime.

<Receivers>
  <Receiver>
     <Party agency="001" scheme="SCH1"></Party>
     <Service>"Service1"</Service>
   </Receiver>
   <Receiver>
     <Party agency="http://sap.com/xi/XI" scheme="Party2"></Party>
     <Service>"Service2"</Service>
   </Receiver>
</Receivers>

 

Steps in Enterprise Service Repository (ESR).

 

Step 1: Create Data Type for input XML file format.

Create data type which reflects the XML inbound file format.

 

Step 2: Create Input Message Type.

Create Massage Type of the sender XML file using the Data Type created in step 1.

Create sender message type in ESR
Create sender message type in ESR

 

Step 3: Outbound Service Interface Configuration.

Create sender Outbound Service Interface for XML file.

Outbound Service Interface with sender Message Type attached
Outbound Service Interface with sender Message Type attached

 

Step 4: Dynamic Receiver Determination Message Mapping.

Message mapping to dynamically determine receiver.
Message mapping to dynamically determine receiver.

In the Message Mapping, we need to determine the receiver and assign the value of the receiver to <Service> element in ‘Receivers’ Message Type.

In this example, if the sum of ‘value1’ and ‘value2’ is greater than 10 then receiver should be ‘Test_A’ else ‘Test_B’.

 

Step 5: Create Dynamic Receiver Determination Operation Mapping.

Operation mapping for extended Receiver Determination
Operation mapping for extended Receiver Determination

Dynamic receiver determination’s target operation should be ‘ReceiverDetermination’ inbound interface under namespace http://sap.com/xi/XI/System of BASIS software component.

Next, attach the Dynamic Receiver Determination Message Mapping we created in Step 4.

 

Steps in Integration Directory (ID).

 

Step 6: Configure Inbound Processing.

Integration Configuration Object Inbound Processing Configuration
Integration Configuration Object Inbound Processing Configuration

XML sender channel assigned to ICO.

 

Step 7: Configure Extended Receiver Determination.

Integration Configuration Object Type of Receiver Determination - Extended
Integration Configuration Object Type of Receiver Determination – Extended

Check the option Extended in Type of Receiver Determination, then assign the Receiver Determination Operation Mapping we created in step no 5. Finally, list the possible receivers.

 

Step 8: Set receiver Interfaces and Operation Mappings.

Integration Configuration Object - Receiver Interfaces and Operation Mapping
Integration Configuration Object – Receiver Interfaces and Operation Mapping

Configure Receiver Interfaces and Operation Mappings for each receiver. Since I am not transforming the input XML file in this example, I have used Dummy Interfaces. But if you are required to transform the message to different formats, create operation mappings and message mappings accordingly.

 

Step 9: Configure Outbound Communication Channels.

Integration Configuration Scenario - Outbound Processing for Receiver A
Integration Configuration Scenario – Outbound Processing for Receiver Test_A

 

Integration Configuration Scenario - Outbound Processing for Receiver B
Integration Configuration Scenario – Outbound Processing for Receiver Test_B

 

Test Integration Configuration Scenario.

When total is less than 10.

<?xml version="1.0" encoding="UTF-8"?>
<ns0:thirdparty_sender xmlns:ns0="urn:thirdparty.com_FileSystem">
   <root value1="1" value2="2"/>
</ns0:thirdparty_sender>

 

Receiver is dynamically assigned at runtime as Test_B.

Message delivered to receiver Test B
Message delivered to receiver Test_B

 

When total is greater than 10.

<?xml version="1.0" encoding="UTF-8"?>
<ns0:thirdparty_sender xmlns:ns0="urn:thirdparty.com_FileSystem">
   <root value1="1" value2="10"/>
</ns0:thirdparty_sender>

 

Receiver is dynamically assigned at runtime as Test_A.

Message delivered to receiver Test_A
Message delivered to dynamic receiver Test_A

 

If you have any queries on Extended Receiver Determination, please leave a comment below.

8 thoughts on “Dynamic Extended Receiver Determination SAP PI/PO

  1. Nagamalleswara Rao says:

    Please give me how to write conditions and how to map the source and target fields in standard and extended receiver determination with real time examples

    • Isuru Fernando says:

      Hi Rao, Check the step 4. This is the mapping program which determine the receiver. You will have another mapping program which between source and target to actual business content mapping. You would use this source to target mapping in the usual way with a Operation Mapping.
      Cheers!

  2. VERTIKA GUPTA says:

    How we can use this for a pass through scenario where we do not have any mapping but receiver needs to be determined based on the date in Filename. The File is a Zip file with a date time stamp and receiver need to be determined only when Filename date matches with current system date.

  3. Joel says:

    Hi Isuru,
    Check on step 9 it says Configure Outbound Communication Channels. I assume this is a typo error as channel on screenshot says receiver. Kindly confirm.
    I currently implementing this type of ICO but having issues with error message as below:

    “com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.xi.routing.RoutingException: There are 1 of 1 Receivers returned by the mapping, for which no receiver configuration exists. <Receivers which could not be determined: "

    In my scenario proxy is triggered in S4/HANA the PI will created a text file (via regular MM) or a excel (.xls) file (thru XSLT) based off the output type selected. The target system is basically the SFTP server but the differentiated the receiver component by adding a party. I have followed the steps in this post so I am not sure exactly what I did wrong.

  4. John says:

    Hi Isuru,

    Great article !

    I try to do it with another data type but I have the following message error ‘Transmitting the message to endpoint using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.RetryControlException: Receiver Determination did not find any receivers at all’

    I have configured 2 receivers.

    I don’t know what is wrong. Could please help ?

  5. Brindha says:

    if u have one input file with many records and each record t be validated. All the records having any empty value padded with spaces then send to mail reciever and all the records with correct data to File reciever. So at a time both the recievers are active but only difference is that mail reciever has the errored records and the file Reciever has the correct data records. Can we fond solution for this scenario

Leave a Reply

Your email address will not be published. Required fields are marked *