cancel
Showing results for 
Search instead for 
Did you mean: 

hold sfc by using API, ERROR has happened.

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Have you found the solution already? If so, please, share it with the community and close this thread.