cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry / Work Manager 6.1 - Loop over a collection in an update rule?

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

I need to create some kind of overview screen containing all the Notification texts like a general overview

I wanted to create a rule with the following structure:

CONCATENATE

- Header description and long text

- For each Activity concatenate description and short text

- For each item cause concatenate description and short text

- For each item task concatenate description and long text.

But as far as I know, Agentry doesn't provide a function that can loop over a collection and concatenate the values of each entry. The functions available are only able to return one collection item. Do you think this is possible somehow?

I will appreciate your inputs.

Marçal

Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Marçal,

I would suggest that you use an Action with looping subction to process the data together and store in a temporary location.  Then you can point the screen field to that temporary location for display of the summarized details.

It might be something that you do in the backend and simply send down to the client as a summarized field as well rather than trying to have the client loop and process.

--Bill

Marçal_Oliveras
Active Contributor
0 Kudos

Thank you Bill,

I will do as you say. I was trying to avoid it since it is a bit complex change (one action for each collection) for such a small purpose, but I guess there is no better option.

Maybe doing it in the backend is simpler but then I will have to extend the structures. I'll think about what is better.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

You might also be able to do it in the Java layer after the data is retrieved from SAP but before sending it to the client.  You would have to check on that further.

--Bill

Marçal_Oliveras
Active Contributor
0 Kudos

Thank you Bill,

I finally did most of it in the Java layer:

- In Agentry I use an update rule to concatenate the header description and notes with all the rest. This way at least the header text is always updated if the user modifies it.

- In Java I loop over all the activities, tasks and causes and then I concatenating all the texts in a new header notification property called Z_OverviewText.

- In SAP I had to implement the BADI method GET_END for the notification fetch and I added the codes texts to the long texts table. I had to do that because in Agentry they are only available in the complex table but not when fetching a notification.

Answers (0)