Skip to Content
author's profile photo Former Member
Former Member

How to use NCProductionService API

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on May 03, 2012 at 09:05 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.