Skip to end of metadata
Go to start of metadata

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.

Step 1:

       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

Step 2:

       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.

Data Type:

Message Type:

 

Message Interface:



 

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.

Sender Agreement:

 
 

Receiver Agreement:

 


 

Step 9:       create the Logical Routing objects(Interface Determination and Receiver Determination)

Interface Determination:

 
 

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.

<?xml version="1.0" encoding="UTF-8"?>
<ns0:FILE_SOURCE xmlns:ns0="XMLnamespace">
   <Records>
      <EMP_ID>0001</EMP_ID>
      <NAME>Rajnarayan Chaturvedi</NAME>
      <DESIGNATION>C</DESIGNATION>
      <DEPARTMENT>SAP</DEPARTMENT>
      <CONTACT_DETAILS>
         <ADDRESS>Kolkata</ADDRESS>
         <PHONE>6352638843</PHONE>
      </CONTACT_DETAILS>
      <CONTACT_DETAILS>
         <ADDRESS>Kolkata</ADDRESS>
         <PHONE>6283034744</PHONE>
      </CONTACT_DETAILS>
      <CONTACT_DETAILS>
         <ADDRESS>Delhi</ADDRESS>
         <PHONE>7568393633</PHONE>
      </CONTACT_DETAILS>
   </Records>
   <Records>
      <EMP_ID>0002</EMP_ID>
      <NAME>Dilip Agarwal</NAME>
      <DESIGNATION>CA</DESIGNATION>
      <DEPARTMENT>Finance</DEPARTMENT>
      <CONTACT_DETAILS>
         <ADDRESS>Mumbai</ADDRESS>
         <PHONE>8374652134</PHONE>
      </CONTACT_DETAILS>
      <CONTACT_DETAILS>
         <ADDRESS>Delhi</ADDRESS>
         <PHONE>7463534478</PHONE>
      </CONTACT_DETAILS>
      <CONTACT_DETAILS>
         <ADDRESS>Gujrat</ADDRESS>
         <PHONE>8373645465</PHONE>
      </CONTACT_DETAILS>
   </Records>
   <Records>
      <EMP_ID>0003</EMP_ID>
      <NAME>Ram Singh</NAME>
      <DESIGNATION>C</DESIGNATION>
      <DEPARTMENT>SAP</DEPARTMENT>
      <CONTACT_DETAILS>
         <ADDRESS>Kolkata</ADDRESS>
         <PHONE>7363542109</PHONE>
      </CONTACT_DETAILS>
      <CONTACT_DETAILS>
         <ADDRESS>Bangalore</ADDRESS>
         <PHONE>7363542222</PHONE>
      </CONTACT_DETAILS>
      <CONTACT_DETAILS>
         <ADDRESS>Chennai</ADDRESS>
         <PHONE>8476001093</PHONE>
      </CONTACT_DETAILS>
   </Records>
</ns0:FILE_SOURCE>



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.

2 Comments

  1. Unknown User (1039ncyue)

    Hi,

    Good work ! I have some doubts in this scenario.

    1.Can we use an external definition in place of idoc  and configure a receiver idoc channel and agreement ? If my understanding is clear, then you mean to say that the idoc can be in any namespace(instead of the usual one wid urn:...) and with any name these things  doesn't matter at all ,only the xsd should be exactly of that of idoc . is it so ?

    2.When you have created the custom idoc itself, u might have created the maxoccurs of the node with "unbounded" , why do u want to go for external definition just to change the occurence? Please clarify this since I am not having that much of expertise with idoc scenarios.

    Regards,

    Laawanya

  2. Anonymous

    Hi Laawanya,

    Answere to your 1st point:

    I have used the XSD of imported IDOC to make a external definition by changing the ocuurence of IDOC element in it. The namespace for the IDOC is always fixed.but you can create external definitions in any namespace.

    in configuration you need to specify the imported IDOC as a interface.

    Answere to your 2nd point:

    In R/3 side we just create some segments with their fields and add those segments to our Bais/IDoc type, then assign that idoc type to message type.

    When we import an IDOC in XI,  XI automatically adds the node <IDOC> in the existing IDOC structure with occurance 1..1 and we can't an imported IDOC structure. So we need to use that imported XSD in an external definition with neccessary changes.

    Hope its clear now.....

    Regards,

    Sankar Choudhury