cancel
Showing results for 
Search instead for 
Did you mean: 

Update History in WD using the rowrepeater

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

>>

You have to insert the entry at specified index ( while adding entry to node, try using the index property )

<<

i didnt get your point, would you please give more explaination, is there a method for doing this?

how can i do that?

thank you

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

you are adding a element to your node probably binding a structure

then you can specify the Index.

lo_nd_obj->bind_structure( new_item = ls_obj set_initial_elements = abap_false index = 0 ).

Former Member
0 Kudos

Hi Baskaran,

Index should be set to 1 instead of 0, if I'm not wrong.

Former Member
0 Kudos

Hallo Manas,

You are right. Index should be 1. I was trying to edit my reply to correct that but i couldnt do that as session time was over.

Thanks for your correction.

Former Member
0 Kudos

i am binding a table, but i am getting an errore wihle using INDEX = 1,

Former Member
0 Kudos

If you are using bind_table method, then no need to mention index, the internal table which you are binding to your node should be sorted according to your requirement. I assume in this internal table you have appended a new row for latest history.

Former Member
0 Kudos

really still not understoot what you do mean with (( I assume in this internal table you have appended a new row for latest history.)) i am binding (BIND_TABLE) this table is filled with STRING (the textedit UI-element) and other nodes ( like date)

Former Member
0 Kudos

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.

Former Member
0 Kudos

look, i knew that you are the best, thank you very much

Former Member
0 Kudos

Hi Thoams hi Manas, thank you, the problem is resolved

Answers (0)