cancel
Showing results for 
Search instead for 
Did you mean: 

Merge/aggregate messages in XI based on common field value

Former Member
0 Kudos

Hi everybody,

Is it possible to merge/aggregate several messages into one in PI/XI, based on a common field value the messages have? if so, can this be done in the mapping?

Example (scenario): I am receiving multiple messages, some of which have the same value in the field GroupId. Is it possible to aggregate the ones that have the same GroupId into a single message? and send one message with multiple items inside instead of multiple messages.

Thank you in advance,

Ion

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

I started the implementation using ccBPM, but I cannot get it to work in the Repository.
Could you please give me any advices on what am I doing wrong, or what am I missing?

Here are the steps that I did so far:

1. Created data types and 2 message types, orderIn and orderOut

2. One async outbound interface, one async inbound interface and 2 abstract interfaces

3. Message mapping (I kept playing with the occurrences, so I don't know if my problem doesn't come from here...)

4. Interface Mapping (outbound interface -> abstract interface):

5. Integration Process (I tried adapting BpmPatternCollectTime from http://sap.com/xi/XI/System/Patterns in SAP BASIS, and set the time to 2 minutes - so all orders that have the same groupID and come inside that interval, to be bundled up in the same output message):

where:

Receive Step:

Container Operation:

Transformation:

Send Step:

(the system highlights with red what has errors)

Container:

Thank you in advance for any suggestions!

Former Member
0 Kudos

Thank you all for the really valuable input. I will try and implement the ccBPM solution you proposed (which seems more straight-forward) after the holidays. So I will get back with the rewards then.

iaki_vila
Active Contributor
0 Kudos

Hi Loan,

Another alternative is storing the messages in files in your application server (first scenario). The second scenario can poll these files, take all the n files available and to generate m messages with multi-mapping. However, in my opinion, the best way is you use a NW BPM or ccBPM like the others SCN members said.

Regards.

Former Member
0 Kudos

Hi,

What is your target adapter ?

Do you want to wait till all the messages are received at PI. What is the wait time(is it constant for all the future message flows)?

Thanks,

Sudhansu

Former Member
0 Kudos

Hi Sudhansu,


The target adapter type is XI Receiver (the receiver is the ERP system). The sender adapter, in case it matters, is a file adapter.


I want to wait for a certain period of time (let's say 30 minutes - this will be a constant); if in that time-frame multiple messages have the same GroupId, I would like to send them as one.


Thank,

Ion

Former Member
0 Kudos

Hi,

You can use correlation (Xpath) to assign messages that belong together to the same process instance in ccBPM if you are using a dual stack installation. you can make use the combination of time dependent and message dependent loops.

Example: Collecting and Bundling Messages from One Interface - Examples and Usage Cases - SAP Librar...

The NW BPM solutions has been suggested by experts in this thread.

Thanks,

Sudhansu

azharshaikh
Active Contributor
0 Kudos

Hi Ioan,

You can develop this using BPM, check the following:

Regards,

Azhar

0 Kudos

Hi Ioan,

you need to implement a BPM process (or ccBPM with older versions of PI) to merge multiple messages.

Please refer to this blog concerning the aggregator pattern for more details about this.

Best Regards,

lars

0 Kudos


Hello Mosincat,

I am not sure about the version of PI you are using but that is possible using a ccBPM where you can collect messages based on a correlation id (in this case GroupID) and then do use a collect step to merge all individual messages into a single message.

or

You can build a regular interface and create a file with append mode (you have to use the group Id as part of the filename using dynamic configuration or variable substation to make the messages with similar group id go to the same file) and keep appending the content to the file, then setup another interface which will pick up this appended file and send to the target.

Regards,

Ravi.