cancel
Showing results for 
Search instead for 
Did you mean: 

how to Loop thru a RFC model

Former Member
0 Kudos

how to Loop thru the RFC model

for(int i=0;i<wdContext.nodeEx_Org_Units().size();i++){

//how to get the attribute each and every columns

//mgr.reportSuccess("id" +nodeEx_Org_Units().getId());

}

Message was edited by:

yzme yzme

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member365727
Active Contributor
0 Kudos

Hi,

When there is a RFC Model with table ouptut....every row in the table can be correlated to elements in the model node...

your model node : <i>nodeEx_Org_Units</i>

Now if you have 5 rows as output after executing the model...there will be 5 elements created under the node. Loop through all the elements and use the get methods as given below:


// assuming tht u have two columns(attributes) <i>col1 & col2</i>
// access the node
IPrivate<view>.IEx_Org_UnitsNode tableNode = wdContext.nodeEx_Org_Units();
// access the element under the node, do not initalize this element
IPrivate<view>.IwdContext.nodeEx_Org_UnitsElement tableElem;

//loop thrugh the elements
for(int i=0; i<tableNode.size(); i++)
{
   tableElem = tableNode.getEx_Org_UnitsElementAt(i);
   // access the attributes col1 & col2
   tableElem.getCol1();
   tableElem.getCol2();
}

Regards

Srikanth

former_member720137
Active Participant
0 Kudos

HI

Try this method..

IPublicyour_controller_or_view.IEx_Org_UnitsElement saveElement=null;

for(int i=0;i<wdContext.nodeEx_Org_Units().size();i++)

{

saveElement = wdContext.nodeEx_Org_Units().getEx_Org_UnitsElementAt(i);

Now u can use saveElement.get() methods to get the contexts..

}

Regards

Message was edited by:

Armin Reichert