Step 2: Measuring Code Coverage 
After you have created a measurement, you do the following to collect code coverage data:
Start measurement of code coverage
Run the tests or activities that should be measured.
Stop the measurement of code coverage.
Stopping a measurement ends the measurement. You cannot add any more code coverage data to it. .
Here is code for starting and stopping the measurement of code coverage.
Syntax
DATA measurement TYPE REF TO if_scv_measurement. measurement->start( ). " Start the measurement " Run your tests. Here, a harmless CCMS standard report submit rsdssmpl_status and return. " Stop the measurement - no more data is recorded measurement->stop( ).
This sample turns on measurement only for a short time and for a discrete activity (though any other activity by the measurement users is also recorded while the measurement is running).
You can also start a measurement in a background job or in a test infrastructure to record multiple separate activities or to record activity for a period of time. See Saving and Reloading a Measurement.
Note the following:
A measurement is client-specific. That is, it is visible only in the client in which you create it. However, a measurement collects activity data from other clients, if the measurement user is also present under the same user name in other clients. Such data is aggregated without distinction in the measurement.
You can have as many measurements active in a system as you wish. The active measurements may be standalone measurements, or they may belong to measurement series.
The users whose activity is being recorded may not overlap in measurements. You cannot start a measurement if:
A user specified in the measurement is already associated with another measurement; and
The other measurement is currently running.
The Coverage API is careful not to affect performance adversely. Even so, you should run as few measurements in parallel as possible.
You cannot restart a stopped measurement. Once a measurement has been stopped, you cannot add new data to it. (You can merge measurements to aggregate their data).
You have now recorded raw data on code coverage. Continue to calculate code coverage results.
See also the complete sample program.