Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

hold sfc by using API, ERROR has happened.

I want to hold sfc by using API, but the NullPointerException has pappened. the source code is following:

SFCBOHandle sfcHandle = new SFCBOHandle(site,sfc);

HoldServiceInterface sfcHoldSvc = Services.getService("com.sap.me.production", "HoldService");

PlaceImmediateHoldGroupRequest holdGroupRequest = new PlaceImmediateHoldGroupRequest();

List sfcList = new ArrayList();

sfcList.add(sfcHandle);

holdGroupRequest.setSfcList(sfcList);

holdGroupRequest.setComments("test comment");

//List reasonCodeList = new ArrayList();

//reasonCodeList.add(new ReasonCodeBOHandle(site, "DEF_IMMED_RC", "H"));

//holdGroupRequest.setReasonCodeList(reasonCodeList);

sfcHoldSvc.placeSfcOnImmediateHold(holdGroupRequest);

the error log is following:

Caused by: java.lang.NullPointerException

at com.sap.me.production.HoldSOBean.holdObjects(HoldSOBean.java:1019)

at com.sap.me.production.HoldSOBean.immediateHold(HoldSOBean.java:139)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46)

... 61 more

how can I hold SFC by coding.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question