on 11-21-2010 9:30 PM
Hi all,
i am programing a history via APAB WD using the Rowrepeater, there is a button 'Write History' on the Portal , when clicking on this button, a popup will appear and the user can write a comment in it, and then , after clicking on (OK) button on the Popup, the comment of the user will appear again in the textedit UI-element of the rowrepeater in the main view.
everything till now is working fine. but the problem is, the rowrepeater is showing the old comment(or the first comment of the user) up of the history, and the second under it as follow;
18.11.2010 first comment
19.11.2010 second comment
20.11.2010 3th comment.
but !! i want the actual date(or the last comment) should appear up (first one) of the history,as follow;
20.11.2010 3th comment.
19.11.2010 second comment
18.11.2010 first comment
is there a way for changing this??
i hope that i explained everything very well that everybody can easelly understand what am i looking for? i will be very happy for any kind of help.
best regards
You are appending the entry to context node bound to row repeater ( so it inserts at end ).
You have to insert the entry at specified index ( while adding entry to node, try using the index property )
or before binding data back, you can sort in descending order of timestamp and then bind the internal table back to context node.
Regards
manas Dua
Edited by: Manas Dua on Nov 22, 2010 11:47 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
While adding a new history item to your row repeater, you must using a method of if_wd_context_node to add new element to node collection. these methods can be BIND_STRUCTURE or BIND_ELEMENT.
In the signature of these methods you'll have index parameter which will allow you to insert a new element at specified position.
To put it at first position use index = 1.
Regards
Manas Dua
On click of OK button of pop up, you can get the node reference ( by using wizard ) and instead of using bind_Table you can use method
set all declared attributes
lo_nd_rowtems->BIND_STRUCTURE(
EXPORTING NEW_ITEM = ls_rowtems index = 1 SET_INITIAL_ELEMENTS = ' ' ).
like the way mentioned above
Here structure ls_rowtems contains your string text and other attributes like date etc.
I hope its clear....
Alternatively, if before calling the bind_table method if you can sort the internal table in descending order of date\ time attribute, then it should give you desired result.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.