cancel
Showing results for 
Search instead for 
Did you mean: 

Get handle to "model" after RFC call

Former Member
0 Kudos

I need to place in httpsession the "model" (structure) returned from my RFC call.

This code does not work:

Zemployee = wdThis.wdGetGetEmployeeController().wdGetContext().nodeOutput().nodeE_Employee().currentE_ReturnElement();

How do you get a handle to the "model" following an adaptive rfc execute?

Thanks,

Kevin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

try This

//If the out put is one record

Zemployee =wdContext.currentOutputElement().getE_Employee();

//for multi records

IPrivate<ViewName>.I<DropName>Node node = wdContext.node<DropName>();

int len=wdContext.node<BAPIList>().size();

for(int l=0;l<len;l++) {

String returndata=String.valueOf(((IPrivate<viewname>.I<BAPIList>Element)(wdContext.node<BAPIList>().getElementAt(l))).get<Parameter>());

IPrivate<ViewName>.I<DropName>Element element = wdContext.create<DropName>Element();

element.set<Param>(returndata);

node.addElement(element);

}

Kind Regards

Mukesh

Former Member
0 Kudos

There is just one row in my structure always (one employee).

There does not seem to be a way to get handle to the whole structure at one time, Zemployee. I can only find a way to retrieve the individual attributes of Zemployee. There is no getE_Employee method.

Kevin

Former Member
0 Kudos

Hi Kevin,

Can you give the error stacktrace when you did this,

Do you get anyother method in the outputStructure

Regards

Saravanan K

former_member182372
Active Contributor
0 Kudos

Hi Kevin,

Every executable RFC model class has "Output" relation which contain result model class. So, to get instance of model object (<i>the whole structure at one time</i>) at one time you need to do something like:

wdContext.currentOutputElement().modelObject()

And you will get the model class of result where you can find all properties by typed access.

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Maksim,

You are exactly correct. Thank you for sharing your knowledge! I will mark the thread as resolved, awarding full points.

Here was the exact syntax that I now use:

zEmployee = wdContext.currentOutputElement().modelObject().getE_Employee();

Kevin

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi kevin

get this like

wdContext.currentmodeloutputelement().getmethod();

And explain you want to handle the outputelement?

Handle the outputelement means,

Determine the number of outputs

Case 1:

if single

get,

wdContext.current<BapiOutputElement>.get<attribute>

Case2:

If it is multiple rows,

using the loop,

for(int i=0;i<size of the outputnode;i++)

{

wdContext.node<BapiInputElement>.getElementAt(i).get<Attribute>

}

}