Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Reg: Inserting values into table

Hi,

I have a context node dealer and attribute as dealer code.

I have assigned this context to a table.

i want to insert some values into the dealer code field of the table.

when i use the below code, its giving outofbound exception.

for(i=0;i<5;i++)

{

wdContext.nodedealer.getdealerelementatindex(i).setdealercode(i);

}

kindly suggest.

Former Member
Former Member replied

Hi,

You want to append values to your table in addition to the values in the node Dealer. You can do it in many ways one way is iterate a loop say up to 5 and if counter value is greater than your node size then create a element, set element values and then bind to the node.

In action Button

for(int i=0;i<5;i++)

{

if (i>wdContext.nodeDealer.size())

{

IPrivateview.IDealerelement ele = wdContext.createDealerelement();

ele.setDealercode("XYZ");

wdContext.nodeDealer().addElement(ele);

}

}

Hope this will solve your problem, revert me if you have any clarifications

Regards

Raghu

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question