Outbound iDocs can be processed as batches or packages in SAP. This technique is also known as packaging or bundling of iDocs. The packaging allows us to send iDocs as a collection or as one data packet to the target system. The iDoc packaging method is highly useful if you want to send multiple iDocs as a single message to the target system.
In this article, we will discuss the SAP ALE/iDoc configuration related to iDoc packing. Also, we will look at iDoc adapter (iDoc_AAE) configuration for bundling iDocs in SAP Process Orchestrator version 7.1 or higher. Moreover, we’ll learn how to process bundled outbound iDocs using program RSEOUT00.
Pack Size in Outbound iDoc Partner Profile
To configure the iDoc collection in SAP, we need to set up the Pack Size of the outbound parameters of the Partner Profile. But, this parameter can be used only in conjunction with Output Mode “Collect iDocs”.
To configure the Pack size, go to transaction we20 in SAP back-end system and navigate to the outbound iDoc configuration (outbound parameters).
Then assign the number of iDocs per message in the Pack Size parameter.
In this example, every 10 outbound iDocs are sent to the target system as one message.
iDoc Package Size in Sender iDoc Adapter
If you are using the middleware SAP Process Integration 7.1 or higher, for i
In the sender iDoc adapter (iDoc_AAE) there are two important parameters related to iDoc collection under “Inbound Message Settings” of “Adapter-Specific” parameters.
- The checkbox “Multiple iDocs in single XI message”
- Numeric parameter “Number of iDocs in single XI message“
To enable receiving multiple iDocs in the same message, flag the parameter “Multiple iDocs in single XI message”. Next, define the maximum number of iDocs allowed in a single message in parameter “Number of iDocs in single XI message”.
Java iDoc adapter iDoc_AAE uses tRFC transfer protocol and iDoc XML message protocol by default.
In the example shown here, every 10 iDocs are bundled together in one XI message. In the Message Mapping program, you can map the bulk iDoc message to the target message.
iDoc Packing and Program RSEOUT00
When the “Collect iDoc” configuration is activated in the iDoc Partner Profile, outbound iDocs created from outputs, programs, master data distribution framework, etc. will be assigned to status (30) “iDoc ready to be dispatched”. To process iDocs in status 30 and send them to the outbound Port, standard outbound iDoc processing program RSEOUT00 should be executed.
The standard practice is to schedule this program as a periodic batch job in quality and productive environment to process outbound iDocs. Each scheduled job of RSEOUT00 should process one iDoc Message Type and iDoc Basic Type combination.
The parameter “Maximum Number of iDocs” defines the maximum number of iDocs transferred before COMMIT WORK is executed. This parameter only has an impact if you are packaging iDocs in SAP.
But, you need to make sure a reasonable number is assigned to Maximum number of iDocs depending on the size of an individual iDoc processed and system resources. If too high a number is assigned, the system can run into short dumps.
Take the size of an individual outbound iDoc when assigning the maximum number of iDocs to RSEOUT00 background job. If the size of the iDoc is large, a lower number should be assigned. But if the iDoc size is low you have the freedom to assign a higher number. For example, ARTMAS (article master) iDoc is a comparatively heavy iDoc. Hence, a lower number of maximum iDocs should be assigned. On the other hand, for COND_A (price conditions) iDoc a higher number can be assigned as COND_A iDocs are smaller in size.
iDoc Pack Size in SAP vs Number of iDocs in SAP PI/PO iDoc_AAE
As you may have noticed there are two different pack size parameters we can configure in SAP and SAP PI/PO.
- iDoc Pack. Size in Partner Profile – SAP back-end system
- Maximum number of iDocs in single XI message – SAP PI/PO adapter iDoc_AAE
What will happen if the number of iDocs configured in each of these parameters is different?
Let us look at the combinations we can have,
- iDoc Pack size in Partner Profile is equal to the number of iDocs in iDoc_AAE adapter.
- iDoc Pack size in Partner Profile is greater than in iDoc_AAE adapter.
- iDoc Pack size in Partner Profile is less than in iDoc_AAE adapter.
- The maximum number of iDocs in the iDoc_AAE communication channel is blank.
iDoc Pack size in Partner Profile is equal to the number of iDocs in iDoc_AAE adapter.
Pack Size in Partner Profile | Package Size in Sender Adapter (iDoc_AAE) | Number of iDocs Processed (sent from SAP HANA) | Number of XI messages in PI/PO (iDocs in the XI message) |
10 | 10 | 8 | 1 (8) |
10 | 10 | 9 | 1 (9) |
10 | 10 | 10 | 1 (10) |
10 | 10 | 11 | 1 (10) + 1(1) |
iDoc Pack size in Partner Profile is greater than in iDoc_AAE adapter.
Pack Size in Partner Profile | Package Size in Sender Adapter (iDoc_AAE) | Number of iDocs Processed (sent from SAP HANA) | Number of XI messages in PI/PO (iDocs in the XI message) |
10 | 9 | 8 | 1 (8) |
10 | 9 | 9 | 1 (9) |
10 | 9 | 10 | 1 (9) + 1 (1) |
10 | 9 | 11 | 1 (9) + 1(1) + 1(1) |
iDoc Pack size in Partner Profile is less than in iDoc_AAE adapter.
Pack Size in Partner Profile | Package Size inSender Adapter (iDoc_AAE) | Number of iDocs Processed (sent from SAP HANA) | Number of XI messages in PI/PO (iDocs in the XI message) |
8 | 10 | 7 | 1 (7) |
8 | 10 | 8 | 1 (8) |
8 | 10 | 9 | 1 (8) + 1 (1) |
8 | 10 | 10 | 1 (8) + 1 (2) |
8 | 10 | 11 | 1 (8) + 1 (3) |
The maximum number of iDocs in the iDoc_AAE communication channel is blank.
The parameter “Maximum number of iDocs in Single XI message” of iDoc_AAE adapter is optional. Hence, you can leave it blank in the sender iDoc Communication Channel.
if you leave the parameter blank and control package size via
One advantage of leaving this parameter blank is that you will be able to use the same sender iDoc Communication Channel in different integration scenarios with different package sizes in partner profile.
Sample-Bundled Outbound iDoc XML
Let us look at how a bundled iDoc XML looks like. Here we have the output iDoc XML of iDocs packed with size 5.
When you package iDocs, under the main iDoc basic type tag (in the example <COND_A04>) you will find repeating <iDoc> XML segments. At runtime this entire message will be passed to the mapping program in SAP PI/PO at once.
Message Mapping and Operation Mapping of Bundled iDoc
In SAP PI/PO single stack versions with iDoc_AAE adapter you can use the iDoc imported from SAP as the source message of the Massage Mapping program and Source Operation of Operation Mapping program.
With HTTP iDoc adapter and new Java only SAP PI/PO, you do not have to adjust the iDoc XSD manually to change the occurrence.
Outbound Service Interface
Use imported iDoc service interface as the outbound service interface of iDoc collection scenario.
To summarize, you control outbound iDoc packaging using Pack Size in Partner Profile and iDoc_AAE sender adapter. Depending on the package sizes defined, the process of bundling will differ. Collected outbound iDocs should be processed using program RSEOUT00. The program should be scheduled as a background job to process iDocs automatically.
If you have any questions, please leave a comment below.
Hi Sir,
It was a great blog on idoc Packaging scenario.
In the same way can you please explain idoc serialization and idoc acknowledgment ALEAUD in sap po scenarios.
Thanks sai.
Hi Sir,
I followed the same but i am not getting the bundled idocs to PO.
IDOC message type and only one IDOC under this.
Ex:
Kindly help me.
Hi Isuru,
Thanks for your post about collecting multiple IDocs into a single XI message. This scenario is especially useful if for example you want to create an EDI X12 message with multiple transaction sets ST corresponding each IDoc in the XI message.
However, i came across the following write-up which says that to make the collection of multiple IDocs into a single XI message work, you have to create an XML-HTTP or XML-File port type in tcode WE21 as oppose to the normal RFC port type for PI.
https://fdocuments.in/document/how-to-send-multiple-idocs-within-one-xi-message-multiple-idocs-within-one.html
Regards,
Jamaic