Show TOC

Step 6: Finding Measurements and Results in a Measurement SeriesLocate this document in the navigation structure

Procedure

In the last tutorial step, we saved measurement series, measurements, and results in the repository of the Coverage API.

In this section, we look at the repository methods for retrieving these objects from the repository. Here, the focus is on retrieving results for purposes of reporting or trend analysis.

Here is some sample code for finding measurements and results.

" Start by loading a series by name
DATA: series TYPE REF TO if_scv_series,
      repository TYPE REF TO if_scv_repository.
series = repository->load_series( 'MY_UNIQUE_SERIES' ).

" Find the measurements in a series
DATA: measurements TYPE if_scv_measurement=>tab,
      measurement TYPE REF TO if_scv_measurement,
      measurement_results TYPE if_scv_result=>tab.

" Get all measurements saved in a series
measurements = repository->find_measurements_by_series( series ).

" Get the results from one measurement
read measurements into measurement index 1.
measurement_results = 
  repository->find_results_by_measurement( measurement ).

" Get a set of results by name from a series
DATA series_results TYPE if_scv_result=>tab.

" Get all instances of the result with the name 'PACKAGE_SMOI'
series_results = repository->find_results_by_series(
  i_series = series  i_result_name = 'PACKAGE_SMOI' ). 

         

The repository FIND methods are flexible. You can retrieve:

  • measurements that belong to a series

  • results that belong to a series

  • results that belong to a measurement

You can also retrieve series and results by name.

The FIND methods return measurements and results in chronological order, newest last (highest row number in the internal table). .

Here are the repository FIND methods:

  • IF_SCV_REPOSITORY->FIND_MEASUREMENTS: Returns all measurements in the repository. You can then select among them by measurement name or other attribute.

  • IF_SCV_REPOSITORY->FIND_MEASUREMENT_ID_BY_TESTKEY: Finds the identifier of a measurement by way of the test key of the measurement. With IF_SCV_REPOSITORY->LOAD_MEASUREMENT you can then load the measurement using the ID.

  • IF_SCV_REPOSITORY->FIND_RESULTS_BY_MEASUREMENT: Returns the results of a measurement. You can specify the name of the set of results that you wish to have.

  • IF_SCV_REPOSITORY->FIND_SERIES: Returns all measurement series.

  • IF_SCV_REPOSITORY->FIND_MEASUREMENTS_BY_SERIES: Returns the measurements of a measurement series. You can specify the status of the measurements that you wish to see.

  • IF_SCV_REPOSITORY->FIND_RUNNING_MEASUREMENT: Returns the active measurement of a measurement series.

  • IF_SCV_REPOSITORY->FIND_RESULTS_BY_SERIES: Returns the results of a measurement series. You can specify the name of the set of results that you wish to have.

Once you have found results, you can extract the coverage statistics from individual results for use in e-mails or reporting. You can also display a result with the built-in graphical display of the Coverage API.

The Coverage API does not offer any display facilities for working with sets of results. For trend analysis or more sophisticated reporting, you can use SAP Graphics or download coverage statistics to a spreadsheet program.

This section ends the tutorial about working with measurement series.

Here is the complete tutorial program.