cancel
Showing results for 
Search instead for 
Did you mean: 

Table Data is not adding

Former Member
0 Kudos

HI all,

1. I hav a table which has node which has recursive node that means its like tree table. i can display all the data in tree everything is fine. But if i check the my node size it is not increasing. that mean its displaying size as 1. remember the data is added to the node during on load child that is sublevel. the issue is i could't able to recollect the entire data from node since its size is 1.

newDElement = node.createDElement();

node.addElement(newDElement);

newDElement.setEmpid(1);

.........etc.,

i used the above code to add the element. but it is not adding but it is displaying in table. but node its not added and its size is always 1.

2. the other issue is i want to map all values of table which are visible. example

if table has 100 rows and visible row count is 15 and currently table is displaying rows 15-30 as current table view values i want these values to be added to another node. that is current visible rows. how to do it.

awaiting for your replies,

regards,

Ganesh.D

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Ganesh,

1. <i>i used the above code to add the element. but it is not adding but it is displaying in table. but node its not added and its size is always 1.</i>

If it is shown, then it is in fact added The problem is how you calculate size. Please post your code or explain algorithm / properties used.

2. <i>if table has 100 rows and visible row count is 15 and currently table is displaying rows 15-30 as current table view values i want these values to be added to another node</i>

The actual implemenation may differ depending on type of Table/Node. For "plain" node and regular Table it is extremly simple: just map firstVisibleRow property of table to new context attribute (type integer), then write something like this:


final IPrivate<ViewName>.I<TableNodeName>Node tblNode = wdContext.node<NodeName>();
final int firstVisibleRow = wdContext.currentContextElement().getFirstVisibleRow();
for (int i = firstVisibleRow, last = firstVisibleRow + 10 /*NUMBER OF VISIBLE ROWS*/; i < last; i++) {
  final IPrivate<ViewName>.I<TableNodeName>Element tblEl = tblNode.get<TableNodeName>ElementAt(i);
  /* process element */
}

For recursive node and so-called TreeTable the algorithm is a bit more complex, but it is also possible.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

HI valery,

I dont have any property/method called getFirstVsibleRow() in the context. for your information my node is DATA which has recursive node(for tree purpose), i load values using bapi at runtime when the user tries to expand the root node and so on. so at runtime i am adding the newdata element values when user clicks using on load child or xxxx action i am extracting the data. when new value added it is displaying in table in tree form as i specified. but if i check the size of node it is empty always. from the values of current visible row of table i have to display Business Graph.

i think you r clear now. if you want more please reply back.

regards

Ganesh.D

lajitha_menon
Contributor
0 Kudos

Hi,

Please check Valery's reply in this thread...

https://forums.sdn.sap.com/click.jspa?searchID=172647&messageID=2757876

cheers

LM