cancel
Showing results for 
Search instead for 
Did you mean: 

SAP ME SDK - DataCollectionServiceInterface

Former Member
0 Kudos

Hello all,
I was wondering if anyone out there has successfully been able to use the SAP ME SDK to submit a Data Collection using the com.sap.me.datacollection.DataCollectionServiceInterface class and createParametricData method?

When creating the many layers needed for the method I keep getting the generic exception: com.sap.me.datacollection.MissingParameterNameException

Unfortunately I cannot find which parameter I am missing.

I would like to use the supported API instead of submitting this same information using the ProductionXML which I have done in the past.

If someone could point me in the right direction I would appreciate it.

Thank you,
Mike Jewson

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello all,

I figured out that the MissingParameterName was for the MEASURE_GROUP. Even tho the API documentation does not have it as part of the "Required Fields Constructor".

In any case, I have tried adding the measure group:

CreateParametricMeasure parametricMeasure = new CreateParametricMeasure(

  "PASSTICKET", ParametricTestStatus.PASS,

  ParameterDataType.TEXT, result, false, false, false, true);

parametricMeasure.setMeasureGroup("DC_FCT");

But now recieve the following error:

javax.ejb.TransactionRolledbackLocalException: (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@1dd3d22b for bean sap.com/me~ear*xml|me.datacollection.ejb-5.2.6.19-Base.jar*xml|ParametricBO in application sap.com/me~ear.; nested exception is: java.lang.ClassCastException: ; 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@1dd3d22b for bean sap.com/me~ear*xml|me.datacollection.ejb-5.2.6.19-Base.jar*xml|ParametricBO in application sap.com/me~ear.; nested exception is: java.lang.ClassCastException: ; nested exception is: javax.ejb.EJBTransactionRolledbackException: (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@1dd3d22b for bean sap.com/me~ear*xml|me.datacollection.ejb-5.2.6.19-Base.jar*xml|ParametricBO in application sap.com/me~ear.; nested exception is: java.lang.ClassCastException: ; 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@1dd3d22b for bean sap.com/me~ear*xml|me.datacollection.ejb-5.2.6.19-Base.jar*xml|ParametricBO in application sap.com/me~ear.; nested exception is: java.lang.ClassCastException:

Again I would like to use the API instead of the Production XML Request, but it is certianly not looking good.

Any help would be appreciated.

Thank you,

Mike Jewson

Former Member
0 Kudos

Hi Mike,

Try with the following code.

DataCollectionServiceInterface dataCollectionService =      ServiceLocator.getService("com.sap.me.datacollection", "DataCollectionService");

CreateParametricRequest request = new CreateParametricRequest();

      request.setDcGroupRef(dcGroupRef);

      request.setOperationRef(operationRef);

      request.setGboRef(sfcRef);

      request.setItemRef(itemHandle.toString());

      request.setRouterRef(routerRef);

      request.setShopOrderRef(shopOrderRef);

      request.setShopOrder(shopOrderName);

      request.setType(DataCollectionType.VM);

      request.setTestStatus(ParametricTestStatus.FAIL);

      request.setTestPassed(false);

     

      CreateParametricMeasure measure = new CreateParametricMeasure();

            request.setParametricMeasureList(Collections.singletonList(measure));

      measure.setMeasureName("");

      measure.setActual("");

      measure.setMeasureStatus(ParametricTestStatus.FAIL);

      measure.setDataType(ParameterDataType.TEXT);

      measure.setMeasureGroup("");

      ParametricResponse response = dataCollectionService.createParametricData(request);

Former Member
0 Kudos

Hi,

Thank you for the reply. I actually did figure out which parameter was missing by catching the Exception and casting it to the MissingParameterNameException then called the getName() method.

Turns out that the code that you posted above is pretty much what I have except that with the setMeasureGroup() method not having an actual value it throws a com.sap.me.frame.domain.RequiredValueValidationException

After filling in the actual measure group I still get an exception com.sap.me.frame.domain.RequiredValueValidationException

Just not sure what value it is expecting. Have tried just the name, the full BO as well as other subsets and combinations.

Thanks,
Mike

Former Member
0 Kudos

Hi Mike,

you need to create a DCGroup manually in Data Collection Maintenance and pass that DCGroup  in 

setMeasureGroup()

Former Member
0 Kudos

Hi,

Thanks for the reply. In my second post where I pasted my code I showed that I am already doing this: parametricMeasure.setMeasureGroup("DC_FCT");

The DC_FCT is the DC Group that has been created in the Data Collection Maintenance.

So the group has already been created and I have been using the Production XML for the past 4 years without problems. I am just trying to use the given API so that I am covered during the next upgrade seeing that the Production XML will not be supported anymore.

So I know that it works and has been working. I am just trying to use the API.

Thanks,

Mike