Skip to Content

Background Information
Many technical systems can only receive batches of data like, for example
one file with many business transactions, many master data objects (customers, materials).
It may be possible for those systems to receive the data on “one object per one file” basis but quite often
such systems wouldn’t be able to handle it efficiently. SAP application systems in most cases use IDocs
to send data to other external systems. IDocs can be send in two ways:

a) immediately after they are created

b) as a package with a special report – RSEOUT00

Unfortunately even if we send a package with report RSEOUT00 XI/PI will still split them
on – one IDoc – one XI/PI request message.

What are the approaches then to send the many IDocs in one file ? 

 

1. Using IDocs that can handle multiple objects

Some IDoc have an occurance greater then one which means that more then object can be sent
in just one IDoc. Like for example we have DEBMAS03 IDOC which can only send one client master data
and DEBMDM can send the same set of data (also client master data) but the occurance is 1..9999.

One of my articles provide a little bit more details on this approach:

Provide more efficient master data management integration with SAP’s new mass interfaces and extractor programs

Advantages 

+ very easy to use – no need to have any special service pack etc. and IDocs can be configured
to be created and sent immediately after the program run

Disadvantages

– there is only a certain number of objects (mostly master data) that can be used in this way
so if you need any other object you need to create it on your own 

 

2. Using a BPM to collect IDocs

PI/XI offers an easy to develop so called collect pattern which allows to group messages
from different sources with the use of a business process. This patterns cna be prepared
in many ways but one of them could be waiting for a certain number of time or for a certain number of messages
then mapping them into one message and sending to the receiver.

Advantages

+ very easy to develop – as all you need to do is a desing a simple BPM inside XI/PI

Disadvantages

– since we need to use a business process for handling many documents this is a highly ineffective pattern
in terms of efficiency – it will be very slow and you will experince many issues with it

– SAP not recommended pattern – because of the issues with performance

please don’t use it 🙂

3. Using a file port

All SAP systems that allow IDoc usage send them with the use of ports (transaction WE21).
The most common type of port is tRFC which allows sending IDocs to PI/XI with the use of IDoc
adapter. However there are a few other ports as well as for example file port. This kind of port
allows sending many IDocs to one file from where it can be fetched by PI/XI’s file adapter.
This approach is described by Stefan in this blog:

Collecting IDocs without using BPM

Advantages

+ relatively very easy to develop
+ PI/XI will only fetch one file with multiple objects without the use of a business process

Disadvantages

– in many big companies you will not be allowed to use file ports for handling IDocs
– this approach shows that PI/XI is ont the best EAI tool there is… and we don’t want to show that 🙂

4. Using an HTTP destination

Another approach shows the use of another IDoc port – http port. The approach is similar
in terms of the idea to approach with file port but the good thing is that
there is no need to store the file on the file system as the message goes directly to SAP PI/XI
This approach is very well described in this article:

How To… Send Multiple IDocs Within One XI Message

Advantages

+ relatively very easy to develop
+ flow goes directly to SAP PI/XI (as compared with approach No. 3.)
+ PI/XI will only fetch one file with multiple objects without the use of a business process

Disadvantages

– only one but pretty big – if the connection between SAP application system (IDoc sender) and SAP PI/XI
is interrupted IDoc will go to status 02 and it cannot be restarted. Each time this happens
you need to check if PI/XI received the message or not and resend it if necessary from SAP application system.

 

5. Having Enhancement Package 1 (EhP1) for PI 7.0

As of Enhancement Package 1 (EhP1) there is a way to receive multiple IDocs in PI/XI and
PI/XI does not split them anymore. The idea of the approach is described in my blog:

XI/PI: sender IDOC adapter packaging ?

and the actual implementation and configuration is described in the second edition of my book:

Mastering IDoc Business Scenarios with SAP NetWeaver PI

Advantages

+ very easy to develop
+ can be resterted if the flow is interrupted (as compared to approach No 4.)
+ PI/XI will only fetch one file with multiple objects without the use of a business process
+ this is the – best practice way – of collecting IDocs

Disadvantages

– you need to have EhP1 for SAP PI 7.0 (released)
– or you need to have EhP1 for SAP PI 7.1 (not yet released – at the time of wrting this article)

Hope this gives you a nice overview of all possible options for collecting IDocs.

To report this post you need to login first.

8 Comments

You must be Logged on to comment or reply to a post.

    1. Michal Krawczyk Post author
      hi Sachin,

      thanks 🙂
      hope it will be a nice reference blog for many
      questions about it on PI/XI forum

      Regards,
      Michal Krawczyk

      (0) 
  1. Prateek Raj Srivastava
    I guess a couple of days back there was a similar query we replied. And then when I saw this blog, I understood your intentions of cutting down the Forum questions 🙂

    Best regards,
    Prateek

    (0) 
  2. sridhar reddy kondam
    Hi Michael,
    Your blogs are superb…
    Once we started using the IDOC packaging, the perforamnce has increased much better.

    we are using the same IDOC
    packaging for most of the Interfaces as they are sent trhough packages from SAP.

    But when SAP sends IDOCs(say 20 DELVRY06 idocs per EVERY HOUR) and if any error in the mapping then all the 20 IDOC’s will not be sent, since all 20 are sent as 1 message.(Eventhough chances of errors are rare)

    As of now if any error occurs then i need to copy all the payload (20 idocs) and test in the Mapping and then correct or remove the wrong one and send again in RWB…

    Please can you give inputs and suggest if we can have better way in error handling if any?…

    Regards,
    Sridhar

    (0) 
  3. Raj Thukiwakam
    The blog is really good,thanks alot .

    Actually i developed one scenario where i have to collect IDocs for every day(24hours)and have to send to file system.

    I done using BPM,but i am planning to implement the same without BPM,we are currently on PI EHP1.is there any way??

    when i read the help documentaion about IDoc packaginf it is based one number of IDocs.

    thanks,
    Raj

    (0) 

Leave a Reply