cancel
Showing results for 
Search instead for 
Did you mean: 

Java.Lang.Null Pointer Exception

Former Member
0 Kudos

Hi all

Webdynpro java

I want execute a bapi and need to pass some values from the view elements

when assigning the values to bapi attributes,its is throwing

Null pointer Exception

Any initializations need to be done here

plz help me out

wdContext.currentMatnrselectionElement().setMatnr_Low("*" );

wdContext.currentMatnrselectionElement().setOption("CP" );

wdContext.currentMatnrselectionElement().setSign("I" );

above here is the sample code where i asm assaigning values to model attributes

thanks

madhu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Did you first get a reference to the node and create a new element for that node before you use the set methods?

If not use the following:

I<node name>Node myNode = wdContext.node<node name>();

I<node name>Element newEl = myNode.create<node name>Element();

where <node name> is the name of your context node and then you can say

newEl.setMatnr_Low("*" );

newEl.setOption("CP" );

newEl.setSign("I" );

myNode.addElement(newEl);

Thashin

Edited by: Thoshin Naicker on Jan 8, 2009 12:27 PM

Former Member
0 Kudos

Exact answer,Thanks for the soln.It is solved

thanks madhu

Answers (0)