cancel
Showing results for 
Search instead for 
Did you mean: 

How to use NCProductionService API

Former Member
0 Kudos

Hi Experts,

I am trying to LogNC in an activity hook at POST_START hook point. I am trying as follows. I need to set Site,Sfc,UserId etc. However I could not find those methods in "CreateNCRequest" class.Suggest me  the direction.

NCProductionServiceInterface ncProductionServiceInterface = Services.getService("com.sap.me.nonconformance","NCProductionService");

CreateNCRequest createNCRequest = new CreateNCRequest();

   createNCRequest.setSfcRef("");

   createNCRequest.setQty(new BigDecimal("1.0"));

   createNCRequest.setComments("");

   createNCRequest.setFailureId("");

   createNCRequest.setNcCodeRef("");

     

  nCProductionService.createNC(createNCRequest);

If I try the abve code I am getting the following messages in NW trace.

com.sap.me.frame.domain.RequiredValueValidationException: class com.sap.me.nonconformance.NCRequestactivity.

at com.sap.me.frame.domain.XmlElementValidator.validate(XmlElementValidator.java:34)

at com.sap.me.frame.domain.GenericSchemaValidator.validateObjectAgainstClassFields(GenericSchemaValidator.java:79)

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

tim_drury
Active Participant
0 Kudos

sfcRef is required and "" is not going to be a valid SFC Ref.  NcCodeRef is not required, but "" will not work as that's not a valid reference.  Either don't call setNcCodeRef() or set it to null.

-tim