Skip to Content
0

List View Increment with Button Action

Jul 07, 2017 at 05:59 PM

127

avatar image

I'm trying to develop a screen that allows the user to move the orders up or down with corresponding buttons. Eventually I'll concatenate the current sort key into the sort key using the mid formula to change the appearance on the main page. I'm having 3 issues:

1) When attempting to SUM(Global Variable{1} with Current property) it concatenates them. So SUM(1 and 0) becomes 10 not 1. So image below shows 1110, which was 3 up clicks.

2) Selecting the row and clicking a button event doesn't adjust the selected row where the action targeted the current screen's list view's current object. I clicked up with the first row selected and it affected the fifth row's value. Currently using this link to see how to adjust:

https://archive.sap.com/discussions/thread/3548428.

3) Is there an easy way to get the index position value using Agentry to establish the current sort order field value?

Thank you,

Brad

sort-orders.png (44.0 kB)
10 |10000 characters needed characters left characters exceeded

Disregard number 2 above. I found the solution for that by changing my target objects in the transaction by pointing to the target object and selecting none for the target property.

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Bill Froelich
Jul 10, 2017 at 02:13 PM
0

1) I would guess that your values are strings. When SUM works with strings it is equivalent to CONCATENATE. If you want mathematical SUM you will need to make sure your parameters are a numeric type. You can use FROM_INTEGRAL_NUMBER to set the context of the parameters to numbers so SUM should then return the result you expect.

3) No there isn't a way to get a position value from Agentry since it is dynamic based on the sorting applied to the list.

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Thanks for taking a look, Bill.

Can a temporary counter be added that'd simply increment by 1 each time through the loop and update the current sort order/position for each row which I can fix sort and accomplish the same goal? The collection I'm pulling these records from is sorted within the correct order. User sorting will be disabled, but user may increment/decrement current sort order/position by 1 with the corresponding up/down buttons.Currently it's just adding one to each row instead of i++.

I've attached screenshots below of what I currently have.

Sub action of an action that was directed to after main screen drop down event click. After this sub action is a navigation action to the Sort MOM Orders.

Transaction within the sub action followed by apply.

Transaction property to change

Rule to increment the current sort order/position by 1.

Thanks,

Brad

dv2mo.png (12.1 kB)
o97sg.png (12.0 kB)
xj7eg.png (19.0 kB)
tlulp.png (5.6 kB)
0

Bill, I found a potential solution, but getting held up by the inability to sort the collection before acting upon it. Does Agentry allow the ability to sort a list of orders and sort the entire stack when a new order comes in? If so, how?

Thanks

0

I believe any new objects get added to the end of the collection. Any sorting is done at the UI layer not the underlying collection.

I am not totally following how your are intending to sort the list to allow the movement of the items but it should just entail knowing the old value, and iterating over the list to increment everything greater than the old value that isn't the object you updated to make room for the selected object to be updated.

--Bill

0

I'm mainly seeing if Agentry can take a previously sorted Order collection based on sortkey on the Main Screen and using the position of those items and pulling that data into the Sort Screen. So when I increment the count, as I iterate through each order in the collection, it'll match the position of that order found on the Main Screen. When the user is on the Sort Screen and clicks up, it'll change the count/CurrentSortPosition value on the screen directly allowing for a dynamic sort. I have the logic set up except the underlying Order collection object is being pulled in rather than the index position of that Order object listed on the Main Screen.

Main Screeen list sorted on ascending Sortkey: Sortkey -123 (underlying position 2), Sortkey - 456 (underlying position 1), Sortkey - 789 (underlying position 3)

Current Sort Screen view sorted on Count: Sortkey - 456 Count 1, Sortkey - 123 Count 2, Sortkey - 789 Count 3

Ideal Sort Screen view sorted on Count: Sortkey - 123 Count 1, Sortkey - 456 Count 2, Sortkey - 789 Count 3

Thanks,

Brad

0