cancel
Showing results for 
Search instead for 
Did you mean: 

Error in code like...

Former Member
0 Kudos

Hi,

I have errior of java,.null pointer ...at following codes.

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

{

//@@begin onActiontoSubmit(ServerEvent)

IWDMessageManager Manager = wdComponentAPI.getMessageManager();

try

{

wdContext.currentRequisition_ItemsElement().setPreq_Item(wdContext.currentRequisition_ItemsElement().getPreq_Item());

wdContext.currentRequisition_ItemsElement().setDoc_Type(wdContext.currentRequisition_ItemsElement().getDoc_Type());

wdContext.currentRequisition_ItemsElement().setDeliv_Date(wdContext.currentRequisition_ItemsElement().getDeliv_Date());

wdContext.currentRequisition_ItemsElement().setMaterial(wdContext.currentRequisition_ItemsElement().getMaterial());

wdContext.currentRequisition_ItemsElement().setPlant(wdContext.currentRequisition_ItemsElement().getPlant());

wdContext.currentRequisition_ItemsElement().setQuantity(wdContext.currentRequisition_ItemsElement().getQuantity()

wdContext.currentBapi_Requisition_Create_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

}

catch(WDDynamicRFCExecuteException ce){

Manager.reportException(ce.getMessage(), false);

Please help me ..help will be rewarded.

Gurprit Bhatia

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

wdContext.currentRequisition_ItemsElement()

What is the cardinality of the node Requisition_Items.

if its not 1..n then create an element and then access this.

Regards

Ayyapparaj

Answers (3)

Answers (3)

former_member485701
Active Participant
0 Kudos

Hi ,

(1)Requisition_Items is not getting populated before you use it.

(2) set collection cardinality for Requisition_Items to 1:1 or 1:n

Regards,

Praveen

Former Member
0 Kudos

u need to initialize currentRequisition_ItemsElement in the wdDoInit() and bind to the context node.

Former Member
0 Kudos

Hi,

Code looks like u r trying to execute some model. If it is so, check if all the input u r passing is not null. Print and Chcek. After exceuting, check if response is generated successfully. If u need more help, reply.

Regards,

Harini S