cancel
Showing results for 
Search instead for 
Did you mean: 

Null Pointer Exception on Action

Former Member
0 Kudos

Hello,

I am currently trying to call an RFC that will bring back a table of data that I want to put as a drop down list. I have gotten this to work before, but for some reason, this time I am getting a Null Pointer Exception when I hit the action button. In view 1, I have 2 input fields that are sent to the RFC. When the action button is pressed, it should call the method in the controller that will invoke the RFC. When I press the button I immediately get the error. Here is part of the stack trace:

java.lang.NullPointerException

at com.hp.toolset.input.NPIInput2.onActiononSearch(NPIInput2.java:145)

at com.hp.toolset.input.wdp.InternalNPIInput2.wdInvokeEventHandler(InternalNPIInput2.java:453)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:252)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:392)

Here is my code in the view:

public void onActiononSearch(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActiononSearch(ServerEvent)

wdThis.wdGetNPIInputCompController().getSearchHelpValues();

//@@end

}

I have the button using this event. I also have a drop down by index that should show the returned data, as I have it mapped to a particular field.

Here is the code in my controller:

//@@begin wdDoInit()

//Setup for getting search help values

searchInput = new Z_Kbp_Test_Rfc_Input();

wdContext.nodeZ_Kbp_Test_Rfc_Input().bind(searchInput);

//@@end

}

public void getSearchHelpValues( )

{

//@@begin getSearchHelpValues()

try {

searchInput.execute();

wdContext.nodeZ_Kbp_Test_Rfc_Input().nodeSearch_Values().invalidate();

}

catch(Exception e) {

msgMgr.raiseException("Error Calling Search RFC", true);

}

//@@end

}

Can someone please help to find where I am going wrong?

THANKS! Kristina

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kristina,

What is the code at line 145?

at com.hp.toolset.input.NPIInput2.onActiononSearch(NPIInput2.java:145)

Regards,

Shubham

Former Member
0 Kudos

What is at NPIInput2.java line 145?

From the posted code, you are not passing any input to RFC <i>Z_Kbp_Test_Rfc</i>. Looks like you need to pass two input values. To pass inputs, use

searchInput.set<name>()

One more thing: Use "DropDownByKey" element if u want to use SVS. "DropDownByIndex" doesn't work.