on 12-14-2010 1:05 PM
Dear All:
I have defined dataType (VenderLot include one field: Vender_Lot ) for Assembl in datatype maintainance page, and then, I set the AssemblyDataType to VenderLot in BOM maintainance page.
1) I want to Assembl BOM's componet to SFC with the SDK API by Using the VenderLot info, I using the following the API is OK?
AssemblyServiceInterface [ Method: assembleComponents ]
2) using the above API , how can the parameter.
AssemblyComponent assemblyComponent = new AssemblyComponent();
assemblyComponent.setBomComponentRef( ? ); // Is this the ref of BOM's Component?
assemblyComponent.setResolvedFromIdentifier( ? ); // what will be set for this one?
assemblyComponent.setQty(new BigDecimal(1)); //this is OK?
//List<AssemblyDataField> assemblyDataFieldList = new ArrayList<AssemblyDataField>();
//AssemblyDataField assemblyDataField1 = new AssemblyDataField();
//assemblyDataField1.setAttribute( ? );
//assemblyDataField1.setSequence( ? );
//assemblyDataField1.setValue(value);
//assemblyDataFieldList.add(assemblyDataField1);
//assemblyComponent.setAssemblyDataFields(assemblyDataFieldList); // what will be set for this one?
List<AssemblyComponent> assComponentList = new ArrayList<AssemblyComponent>();
assComponentList.add(assemblyComponent );
AssembleComponentsRequest assComRequest = new AssembleComponentsRequest();
assComRequest.setComponentList(assComponentList);
AssemblyServiceInterface assemblyService = (AssemblyServiceInterface) com.sap.me.frame.ServiceLocator
.getService("AssemblyService");
assemblyService.assembleComponents(assComRequest);
Please help me resolve this problem.
thank you!
Hi Wenjun,
1) Yes the method is correct
2)here is an example:
AssembleComponentsRequest request = new AssembleComponentsRequest();
request.setSfcRef(sfcRef);
request.setOperationRef(operationRef);
request.setResourceRef(resourceRef);
AssemblyComponent comp = new AssemblyComponent();
comp.setActualComponentRef(itemRef);//"ItemBO:TEST,HDD,A"
comp.setBomComponentRef(bomCompRef);//BOMComponentBO:BOMBO:TEST,PC-BOM,U,A,ItemBO:TEST,HDD,A,10
comp.setQty(BigDecimal.ONE);
AssemblyDataField assyDataField = new AssemblyDataField();
assyDataField.setAttribute("VENDOR_LOT");//assembly field name
assyDataField.setSequence(BigDecimal.valueOf(10));//sequence number for the field as defined in Data Type Maintenance
assyDataField.setValue("VENDOR1");//vendor value
List<AssemblyDataField> assemblyDataFields = new ArrayList<AssemblyDataField>(1);
assemblyDataFields.add(assyDataField);
comp.setAssemblyDataFields(assemblyDataFields );
List<AssemblyComponent> complist = new ArrayList<AssemblyComponent>(1);
complist.add(comp);
request.setComponentList(complist);
AssemblyServiceInterface assemblyService = (AssemblyServiceInterface) Services.getService("com.sap.me.production", "AssemblyService");
assemblyService.assembleComponents(request);
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Ivan
thanks for help .your answer is very useful.
but when i try it like following code, it need Event field to be set. and than I don't know whan can be set for EVENT.
could you tell me how to set it.
thanks!!
AssemblyComponent assemblyComponent = new AssemblyComponent();
assemblyComponent.setActualComponentRef((String)bomComponentData.get("COMPONENT_GBO"));
assemblyComponent.setBomComponentRef((String)bomComponentData.get("HANDLE"));
assemblyComponent.setQty(new BigDecimal(1));
List<AssemblyDataField> assemblyDataFieldList = new ArrayList<AssemblyDataField>();
AssemblyDataField assemblyDataField1 = new AssemblyDataField();
assemblyDataField1.setAttribute("LOT1");
assemblyDataField1.setSequence(new BigDecimal(10));
assemblyDataField1.setValue("VENDOR_LOT");
assemblyDataFieldList.add(assemblyDataField1);
assemblyComponent.setAssemblyDataFields(assemblyDataFieldList);
List<AssemblyComponent> assComponentList = new ArrayList<AssemblyComponent>();
AssembleComponentsRequest assComRequest = new AssembleComponentsRequest();
assComRequest.setComponentList(assComponentList);
assComRequest.setSfcRef(sFCBOHandle.toString());
assComRequest.setOperationRef(operation);
assComRequest.setResourceRef(resource);
assComRequest.setShopOrderRef(shopOrder.toString());
assComRequest.setEvent( ? ); // what can be set for this Event field?.
Hi Ivan
I used you method, but it throwed a exception (13518.simple=Enter a value in the following Assembly Data field %FIELD_NAME%) , I pasted my code as following, please help me check it .
AssemblyComponent assemblyComponent = new AssemblyComponent();
assemblyComponent.setActualComponentRef(
(String)bomComponentData.get("COMPONENT_GBO")); //"ItemBO:TEST,HDD,A"
assemblyComponent.setBomComponentRef(
(String)bomComponentData.get("HANDLE")); //BOMComponentBO:BOMBO:TEST,PC-BOM,U,A,ItemBO:TEST,HDD,A,10
assemblyComponent.setQty(new BigDecimal(1));
assemblyComponent.setRefDes("RefDes");
assemblyComponent.setResolvedFromIdentifier("COMPONENT_SFC");
assemblyComponent.setLocation("R");
assemblyComponent.setTimeBased(false);
List<AssemblyDataField> assemblyDataFieldList = new ArrayList<AssemblyDataField>();
AssemblyDataField assemblyDataField1 = new AssemblyDataField();
assemblyDataField1.setAttribute("LOT1");
assemblyDataField1.setSequence(new BigDecimal(10));
assemblyDataField1.setValue("VENDOR_LOT");
assemblyDataFieldList.add(assemblyDataField1);
assemblyComponent.setAssemblyDataFields(assemblyDataFieldList);
ResourceBOHandle resourceHandle = new ResourceBOHandle(this.site,this.resource);
List<AssemblyComponent> assComponentList = new ArrayList<AssemblyComponent>();
AssembleComponentsRequest assComRequest = new AssembleComponentsRequest();
assComponentList.add(assemblyComponent);
assComRequest.setComponentList(assComponentList);
assComRequest.setSfcRef(sFCBOHandle.toString());
assComRequest.setOperationRef((String)bomComponentData.get("OPERATION_BO"));
assComRequest.setResourceRef(resourceHandle.toString());
assComRequest.setShopOrderRef(shopOrder.toString());
assComRequest.setEvent("EVENT");
assComRequest.setWorkStationRef("WORKSTATIONREF");
assComRequest.setWorkCenterRef("WORKCENTERREF");
assComRequest.setLccRef("LCCREF");
assComRequest.setProcessLotRef("PROCESSLOTREF");
assComRequest.setRouterRef("ROUTERREF");
AssemblyServiceInterface assemblyService = (AssemblyServiceInterface) com.sap.me.frame.ServiceLocator
.getService("AssemblyService");
assemblyService.assembleComponents(assComRequest);
swap the values "LOT1" and "VENDOR_LOT" in the following code:
assemblyDataField1.setAttribute("VENDOR_LOT"); // this is for the field name
assemblyDataField1.setSequence(new BigDecimal(10));
assemblyDataField1.setValue("LOT1");// this is for the field value that is entered during assembly
by the way, you don't need to set all these fields:
assComRequest.setWorkStationRef("WORKSTATIONREF");
assComRequest.setWorkCenterRef("WORKCENTERREF");
assComRequest.setLccRef("LCCREF");
assComRequest.setProcessLotRef("PROCESSLOTREF");
assComRequest.setRouterRef("ROUTERREF");
Hi everyone!
I'm trying to implement pretty much the same use case as Wenjun has done. I followed this thread's proposed solution. But unfortunately I always end up with an "InvalidSFCException". I can't find any further information on that exception. Does anone have an idea of what might be causing that exception?
Thanks!
Hi Juliane,
I see you are using Web Services. The problem could be that when you call the web service you are using different user than the user that started SFC. I guess web service are called under MESYS and your SFC is started under ADMIN.
Try the same user name in web service and ME UI
Ivan
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.