Skip to Content
0
Former Member
Feb 19, 2009 at 05:43 AM

Putting data to R3 table

23 Views

Hi,

I am trying to put data to R3 table while putting data to r3 table i should get a error message if the same name is already exist. If not it should Enter.

At present i have done all the things. But while inserting data i am getting java.lang.NullPointerException

wht might be the reason.

I have written code like this.

try{
    	String str1=wdContext.currentBapi_Fm_Sw_InputElement().getStname();
		String str2=wdContext.currentBapi_Fm_Sw_InputElement().getStnumb();
		Bapi_Fm_Sw_Input input=new Bapi_Fm_Sw_Input();
		input.setStname(str1);
		input.setStnumb(str2);
		wdContext.currentBapi_Fm_Sw_InputElement().modelObject().execute();
		String ch=wdContext.currentOutputElement().getDup();
		wdComponentAPI.getMessageManager().reportSuccess(ch);
		if((Integer.parseInt(ch))==1)
		wdComponentAPI.getMessageManager().reportSuccess("duplicate");
		else
		wdComponentAPI.getMessageManager().reportSuccess("Inserted a row");
    
    }catch(Exception e)
    {
    	wdComponentAPI.getMessageManager().reportSuccess((e.getCause()).toString());
    }

Here Dup is the value which get will be zero if it doesn't have duplicate row.

else it will be one if it has the duplicate value.

Regards,

H.V.Swathi