Combining documents

I’m stuck with a seemingly common problem and I would like to hear how other folks have solved this kind of problem.

I have a broker that receives documents from a certain source. A trigger on the IS subscribes to these documents. The trigger is suspended at timestamp T1 and resumed at timestamp T2. On being resumed it needs to fetch all documents from its queue matching a filter and the trigger service needs to group them into one document.

But how does one maintain the state of the consolidated document between two invocations of the trigger service - since each invocation is a separate thread? Is there some kind of global cache that could be used? If I were using a Java client, it would be extremely simple to perform the same task (fetch documents in a loop, and declare cons doc outside the loop). How does the trigger support this functionality of holding state between two invocations?

Thanks in advance!

Somebody please help out here :slight_smile:

Out of curiosity, what would you like to do with the consolidate document? If you are taking the data contained in it and committing to a resource (lets say a database), you could as well do the consolidation at the resource level, instead of loading the documents in IS memory for a time interval and consolidating them.

Thanks for the reply!
The consolidated document in this case is an IDoc, which pertains to all transactions between two time-stamps. Hence, I need to create it
completely before sending it to SAP.