cancel
Showing results for 
Search instead for 
Did you mean: 

Most recent values in table

Former Member
0 Kudos

HI all,

I am getting certain values from R/3 using adaptive rfc model and displaying those values in a table.But if add a new record in the database i should get that record as a first record in the top in my table which am getting as a last record now.Can anyone suggest me regarding this.

Thanks in advance

Anusha

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Let's say the node in question is called "Test". After adding the new record to the node simply do this:


wdContext.nodeTest().moveElement(wdContext.nodeTest().size() - 1, 0);

The WD runtime will take care of the shuffling.

@Sanyev

The "move" APIs only move the lead selection around. They don't move actual elements.

Regards,

Satyajit

sanyev
Active Participant
0 Kudos

Thanks Satyajit.... My mistake. Corrected the post.

Sanyev

lokesh_kamana
Active Contributor
0 Kudos

Hi sanjay,

Will it replace the 1st record with the new record.

or else insert the new record and arrange the records.

What i am saying is if i have 8 records.

WIll it replace the 1st record and keep the same 8 records.

The solution for this anusha is as suggested by sanjay.

Insert the 1st element by specifying the index.

Then run the loop for the remaining elements from the next index.

Mean to say if ur inserting elemnt in 1 .

and run the loop(i.e.for(i=1;i<x;i++).

Thanks & regards,

Lokesh

sanyev
Active Participant
0 Kudos

Hi Anusha,

Generally in Webdynpro context if you create a new element it will go to the end of the list. If you want to make it the first element then after creation of the new element when you add it to the node use the api

addElement(int index, IWDNodeElement element) on the desired node and set the index to be one.

You can also use the moveElement(int from, int to) api to move the element to the first position.

if the creation happens in the backend then this can be done in the backend r3 system also.

Regards,

Sanyev

Edited by: Sanyev Babu on Feb 4, 2009 1:16 AM