on 09-14-2012 9:00 AM
Hi,
im new in SAP ME (SDK) development. I tried to create parametric measure entries, but i always get an error.
WorkCenterBOHandle wcbo = new WorkCenterBOHandle(site,hs.toUpperCase());
DataCollectionServiceInterface dataCollectionService = ServiceLocator.getService("com.sap.me.datacollection", "DataCollectionService");
CreateParametricRequest request = new CreateParametricRequest();
request.setGboRef(wcbo.toString()); //somthink like WorkcenterBO:MYSITE,HS5
request.setType(DataCollectionType.MANUAL);
request.setTestStatus(ParametricTestStatus.PASS);
request.setTestPassed(true);
request.setValidate(false);
request.setExistingParametricRecord(false);
List<CreateParametricMeasure> lst = new ArrayList<CreateParametricMeasure>();
//One entry for eacht day
for(int index=0;index<7;index++)
{
CreateParametricMeasure measure = new CreateParametricMeasure();
measure.setMeasureName(hs.toUpperCase()+"SCHICHTEN");
measure.setActual(params[index][1]+"_"+params[7][0]+"_"+index+"_"+params[index][0]);
measure.setMeasureGroup("AUFTRAGSPLANUNG");
measure.setMeasureStatus(ParametricTestStatus.PASS);
measure.setDataType(ParameterDataType.TEXT);
lst.add(measure);
}
request.setParametricMeasureList(lst); //its all ok here
try {
ParametricResponse response = dataCollectionService.createParametricData(request); //here it fail
}
catch (BusinessException e) {
e.printStackTrace();
}
Error:
(Failed in component: sap.com/me~ear) Exception raised from invocation of public com.sap.me.frame.Data com.sap.me.datacollection.ParametricBOBean.log(com.sap.me.frame.Data) throws com.sap.me.frame.BasicBOBeanException method on bean instance com.sap.me.datacollection.ParametricBOBean@155fea7 for bean sap.com/me~ear*xml|me.datacollection.ejb-5.2.7.8-Base.jar*xml|ParametricBO in application sap.com/me~ear.; nested exception is: java.lang.ClassCastException: WorkCenterBO:MYSITE,HS5; nested exception is: javax.ejb.EJBException: (Failed in component: sap.com/me~ear) Exception raised from invocation of public com.sap.me.frame.Data com.sap.me.datacollection.ParametricBOBean.log(com.sap.me.frame.Data) throws com.sap.me.frame.BasicBOBeanException method on bean instance com.sap.me.datacollection.ParametricBOBean@155fea7 for bean sap.com/me~ear*xml|me.datacollection.ejb-5.2.7.8-Base.jar*xml|ParametricBO in application sap.com/me~ear.; nested exception is: java.lang.ClassCastException: WorkCenterBO:MYSITE,HS5
The workcenter is in dbo.WORK_CENTER available.
I still tried to put a resourceRef into setGbo() but it didnt work. I think setGbo is the PARA_CONTEXT_GBO in dbo.Parametric table because of the following information:
PARA_CONTEXT_GBO(Required, Key)
The SFC of the unit being tested. [Handle (Foreign Key)](Expanded Archive Columns: PARA_CONTEXT_SITE, PARA_CONTEXT_SFC, PARA_CONTEXT_RESRCE) [SFCBO.]
in API :
public java.lang.String getGboRef()
String
public void setGboRef(java.lang.String value)
value
- allowed object is String
In past i used a service called LogParametricMeasure, but now i want to do it by myself, but guys i don´t get it.
Does someone know a solution and can help me please?
Best regards
Sascha Köhler
Hello Sascha,
put the sfcRef in the request.setGboRef() and try again
Regards
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sebastian,
thank you for your answer. We dont use SFCs for LogParametricMeasure at the moment we use the ProductionServiceService with LogParametricData Webservice. The Webservice works fine, and i dont fill a sfc, just a resource.
I´ll try to consume this webservice in my ejb.
Some other ideas?
Regards
Sascha
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.