cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying RFC table in a view

Former Member
0 Kudos

Hi,

I searched but i did not find suitable solution.

I'm trying to call an RFC with a Date type parameter.

RFC response me with a Table with data in it.

1- I must put RFC output table directly into view table.

2- I must loop RFC output table to make some arithmetic operation.

Is there a code sample for these operations?

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

It should be quite easy by using the templates:

select the view in the left panel and right click over it... select the template->apply... and you'll have some... select first the service controller and follow the steps by writting the bapi you're trying to call... the developer studio will generate the method ( execute<bapi's name>(); )and code necessary to call the bapi and fill up the table

repeat the process, but this time you have to select the table template and chose the node generated by the other template... remember you have to select the node from one of the children of the output node

and for the calculations... well, i recomend you that you add an extra attribute to the output node to keep the results and then after calling the generated execute function, write a code to pass through all the elements' node and do the math


IPrivate<viewname>.I<node name> element = null;

for(int i=0; i < wdContext.node<nodename>().size(); i++){
element = wdContext.node<nodename>().get<nodename>Element(i);

//... the calculation using element.set<attribute>(...) and element.get<attribute>() 

} 

done!!

hope it helps

PD: the only tricky part is passing the parameters to the function wdContext.current<bapi name>_InputElement().set<parameter>(...)