cancel
Showing results for 
Search instead for 
Did you mean: 

ME SDK - Parametric Measure / Parametric

Former Member
0 Kudos

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 :

getGboRef

public java.lang.String getGboRef()
Gets the value of the gboRef property. The Reference to the SFC or Resource of the unit being tested.

Returns:
possible object is String

setGboRef

public void setGboRef(java.lang.String value)
Sets the value of the gboRef property.

Parameters:
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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Sascha,

put the sfcRef in the request.setGboRef() and try again

Regards

Sebastian

Former Member
0 Kudos

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