In a very typical business case we need to generate multiple IDoc instances from the same incoming message having multiple IDoc record data set. It will save the processing overhead of executing the scenario for every IDoc record seperatly.Hence mass data processing will be achieved. Moreover it will also save the processing overhead of using BPM.
As we know that File to Multiple IDOC scenarios can be very easily achieved with BPM.
Here i am describing the steps to achieve the same scenario without BPM, because using BPM in some cases may cause performance issue.
Create one custom IDoc in your R3 side or plan to use one standard or existing IDoc in your R3.
For this scenario I have created a custom IDoc CUSTOM_IDOC.ZRECORD
Now import that IDoc into Integration Repository under imported objects.
Step 3: Now create the Data Type,Message Type and Outbound Message Interface for the source side.
Step 4: Now since our target side is IDOC we will use the XSD from the imported IDOC to create an External Definition for our target side.
Note: before importing the XSD into external definition change the maximum occurance of the "IDOC" element in XSD to unbounded.
Step 5: Now we need to create the Message Mapping betwwen the source and target structure.
Here the mapping is in such a way so that for every Record in source payload one IDOC is created in target.
Step 6: Now create the interface mapping.
Source Interface: Outbound Message interface(File_Source)
Target Interface: Actual IDoc Interface(CUSTOM_IDOC.ZRECORD)
Now in Integration Directory we will configure our scenario.
Step 7: Create communication channels for File Sender and IDoc Receiver.
Sender Communication Channel:
Receiver Communication Channel:
Note: in your XI Box create a RFC destination pointing to the R3 instance where you want to post the idocs and a Port for IDoc adapter containing that RFC destination.
Step 8: Create collaboration agreement objects for Sender and Receiver communication channels.
Step 9: create the Logical Routing objects(Interface Determination and Receiver Determination)
Now let us execute the scenarion.
Step 10: place the source payload in the path specified in the sender communication channel(in our case the path is /tmp/SOURCE.XML).
let us consider the following payload is placed in the source path.
Start the sender communication channel(if stopped before) from RWB.
Goto tcode SXMB_MONI in your XI Box for monitoring the processed XML Messages.
Now login to you R3 system to see the idocs are successfully posted.
As you can see 3 IDocs have been created because we have 3 records in our source payload.
Now in the Data Records of each IDoc you can see the values that present under each Record of the source payload.