cancel
Showing results for 
Search instead for 
Did you mean: 

Event Handler Exception

Former Member
0 Kudos

Hi Friends,

I am trying to call a BAPI from a webdynpro application when a user

hits a button in a table. The table will have a button for each entry.

There is an iView that has the table, a custom controller that executes

the BAPI (model).

I am setting the value of the custom controller context at the onAction event handler of the iView and calling the method executeBAPI once the user hits the button. The problem is it works fine for the first time. If the user hits another button of the table on the same screen it throws a nullPointer exception. ie all the subsequent calls fail.

What could be wrong?

java.lang.NullPointerException

at com.sap.tc.prototype.ITView.onActionEventSelect(ITView.java:160)

at com.sap.tc.prototype.wdp.InternalITView.wdInvokeEventHandler(InternalITView.java:160)

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.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)

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

...

Thanks in advance.

Nathan.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello ,

I am on EP7.0 ERP05 NW04s and trying to modify the ESS Address application by pointing to a custom Function Module rather than the standard one , and getting a similar message like "Attempt to send a message to a non-object value".

Is it because the custom BAPI is returning a null structure value .....?

Looking forward to your help.

Former Member
0 Kudos

wdThis.wdGetTCRegisterCustController().wdGetContext().nodeBapiInput().bind(new Bapi_Input());

I solved it using this statement at the beginning of the event handler. Dont know if its the right approach. Any suggestions on this would be appreciated.

Former Member
0 Kudos

Hi nathan,

If u directly sending data to bapi node,its the only right approach.

regards

Sumit

Former Member
0 Kudos

You can further simplify your code by <b>mapping </b>the view context to the component controller context instead of accessing the controller context via the controller instance.

Armin

Former Member
0 Kudos

Hi nathan,

Can u send the code...what r u doing at line 160 in ITView.java??

regards

Sumit

Former Member
0 Kudos

Hi,

wdThis.wdGetTCRegisterCustController().wdGetContext().currentBapi_InputElement().setCount(count);

This is what i am doing at line 160. And i am setting some more values for the node.

I tried to debug it. I executed this line in the debugger and it shows the following error:

Evaluation failed. Reason(s):

Attempt to send a message to a non object value

Thanks

Nathan.

Former Member
0 Kudos

Hi Natahn,

Ur currentBapi_InputElement() is null it seems.There is no other thing i see which can give u null pointer exception.

regards

Sumit

Former Member
0 Kudos

Hi,

I got it solved. Thanks.

Nathan.