Skip to Content
0
Former Member
May 03, 2012 at 04:39 PM

How to use NCProductionService API

28 Views

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.