Skip to Content
0
Former Member
Apr 08, 2008 at 08:51 PM

Unable to retrieve parameters from RFC Function Module

22 Views

Hi All,

I have created a model for the RFC Enabled function module BAPI_BUPA_CENTRAL_GETDETAIL within my webdynpro program. I am passing parameters to the function module BAPI_BUPA_CENTRAL_GETDETAIL and I have validated that this is being passed correctly by displaying the passed value from the node of the input parameters.

Code used to pass input parameters -

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try

{

wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();

size = wdContext.nodeCentraldataperson().size();

wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));

wdContext.nodeOutput().invalidate();

}

catch(WDDynamicRFCExecuteException e)

{

manager.reportException(e.getMessage(), false);

}

I also see that it returns 1 record by using the code below:

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try

{

wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();

size = wdContext.nodeCentraldataperson().size();

wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));

wdContext.nodeOutput().invalidate();

}

catch(WDDynamicRFCExecuteException e)

{

manager.reportException(e.getMessage(), false);

}

But, when I try to retrieve the value returned it does not fetch that value -

Bapi_Bupa_Central_Getdetail_Output getdata = wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().currentOutputElement().modelObject();

Bapibus1006_Central_Person[] getres = new Bapibus1006_Central_Person[size];

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

wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(i));

getres<i> = getdata.getCentraldataperson();

//String fullname = wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().getElementAt(i).getAttributeValue("Fullname").toString();

String fullname = getres<i>.getFullname();

fullname += Integer.toString(i);

wdContext.currentContextElement().setFullname(fullname);

wdComponentAPI.getMessageManager().reportSuccess("fullname:" + fullname);

}

It always returns 0 or null. Can someone please help me with this issue. The BAPI returns values in structure format and not internal table and hence I dont see the issue there as well.

What can be the problem?

Thanks for all your help in advance.

Best regards,

Divya