The purpose of this document is to show the step by step process of placing one file in two different directories using single receiver communication channel in SAP PI 7.1.
Design Process:
· Open the ESR and ID Components.
· Create the Data Types, Message Types and Service Interfaces.
· Create Message Mapping and Operation Mapping.
As Per the requirement we have to create 2 data types, 2 messgae types, 3 service interfaces (1 for sender and 2 for receiver), 1 message mapping and 2 operation mappings.
DATA TYPE :
Create a data type for sender and receiver as below
Sender /Source Data Type:DT_Sender_Test
Receiver/Target Data Type:DT_Receiver_Test
MESSAGE TYPE:
Here we need to define/create one source and one target message type with respect to data types created.
Source Message Type:
MT_Sender_Test
Target Message Type:
MT_Receiver_Test
Service Interface:
We have to define/create one sender service interface and two receiver service interface. In this case we are creating two interfaces one for each directory.
Source Service Interface:
Servi ce Interface for Receiver 1: SI_Receiver_In
Service Interface for Receiver 2: SI_Receiver_In_1
Message Mapping :
All are 1-1 mapping except Row
Row having below mapping as shown below,
Here using dynamic configuration for passing “directory” and replacing “+” with “\” (check in Receiver interfaces tab of “Integrated Configuration” to find the purpose of replacing).
Parameter: Go to signature tab and add parameter as shown below.
Use the below code in Dynamic Configuration for Directory:
---------------------------------------------------------------------------------------------------------------------------
Dynamic Configuration:
try {
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey targetDirectorykey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
- conf.put(targetDirectorykey,targetDirectory);
return targetDirectory;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}-------------------------------------------------------------------------------------------------------------
Operation Mappings:
We need to create two operation mappings. Because we have created two interfaces, one for placing file in one directory and two for different directory.
Operation Mapping 1:
Operation Mapping 2:
Pass the parameter as Directory, select category as Simple, type as xsd: string, parameter as Import.
Integration Directory :
● Configure the designed objects, interfaces created in the ESR.
● Configure communication channels for sender and receiver.
● File channel configuration we have to specify Source directory and File Name information.
● Receiver channel configuration we have to specify the receiver path and file name details.
● We need to specify the parameters value in Receiver interfaces TAB
Sender Communication Channel:
Create sender file communication channel and assign it in Inbound Processing TAB
Receiver Tab:
Add Receiver in this tab
Receiver interfaces TAB:
Add two Operation mappings in this tab, one for first directory and another for different directory, first directory which is already mentioned in Communication channel for second directory which we are passing at runtime by using Dynamic configuration.
and pass the parameter and its value is
For second directory:
Ex: testing/receiver/sap/pi/ if this is your directory, then you have to pass the directory as mentioned below
++testing+receiver+sap+pi++
Outbound Processing:
Add two receiver interfaces and Receiver communication channel in this tab.
After testing you will find same message id in two different directories.










