cancel
Showing results for 
Search instead for 
Did you mean: 

How to create NC data by using API?

Former Member
0 Kudos

Hi, all

I want to log NC by using API. but can't complet succsessful .

please help me check the following source code.

thanks.

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

CreateNCRequest ncRequest = new CreateNCRequest();

//NC500_part: copy from NC500,and ALLOW_PARTIAL=YES

ncRequest.setActivity("NC500_part");

ncRequest.setSfcRef(new SFCBOHandle(site, sfc).toString());

ncRequest.setValidateNCCodeOperation(true);

// defined NCCODE: NCJPN1

ncRequest.setNcCodeRef(new NCCodeBOHandle(site,"NCJPN1").toString());

ncRequest.setDefectCount(new BigDecimal("3"));

CreateNCResponse ncResponse = ncPSI.createNC(ncRequest);

DispositionRequest disRequest = new DispositionRequest();

disRequest.setActivity("NC500_part"); //what can be set for this Activity, NC500_part is OK?

disRequest.setSfcRef(new SFCBOHandle(site, sfc).toString());

ProductionContext productionCtx = new ProductionContext();

productionCtx.setResourceRef(new ResourceBOHandle(site, "COIL").toString());

disRequest.setProdCtx(productionCtx);

DispositionSelection disSelection = new DispositionSelection();

//DispositionSelection is must need, but what shuold be set?

disSelection.setXXXX();

disRequest.setDispositionSelection(disSelection);

disRequest.setNcCodeRef(new NCCodeBOHandle(site,"NCJPN1").toString());

disRequest.setTotalDefectCount(new BigDecimal("3"));

// DispositionNC

DispositionResponse disResponse = ncPSI.disposition(disRequest);

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

resolved by oss

Former Member
0 Kudos

Who knows it

Former Member
0 Kudos

I log the nc to my SFC,but how to complete the nc process by API?

Wait for you help,thanks