Recently I am working on CRM Interactive Report and I was quite confusing about the difference between these two key figures below:

This report is created based on Reporting Area: ServiceOrder
The technical name for “Gross Value of Service Orders”: /CRMBW/SVO_GV
“Gross Value Header”: /CRMBW/GV_SVOH
From this customizing I know the cache table to display report key figure values for Service Order is: CRMD_DHR_HSRVORD
However in this table there is only one field GROSS_VALUE_H, and how can this single field serve two key figures mentioned in the title of this blog?
Via debugging I have figured out how the key figure values are retrieved from database table and rendered in WebUI.
It consists of two steps:
(1) the guid of orders which fulfills the specified search criteria in WebUI is fetched from CRMD_ORDER_INDEX via reporting framework API CRM_BSP_OIC_1O_SEARCH_FROM_RF.
I write a simple report to simulate the call sent from Reporting UI:
Execute the report, in my system for posting date 2015.01.27, there are five Service Orders & Service Confirmation:
(2) Buffer table CRMD_DHR_HSRVORD is then read with the guid fetched from step1, and key figure calculation is done in BAdI implementation class CL_CRM_RFQ1OCALC_STATUS_COMMON.
In line 638 the logic is clear: the gross value of Service Order key figure is only accumulated when the given order is a Service Order ( object_type = ‘BUS2000116’ ).
This BAdI is called within OLTP extractor belonging to Service Order Reporting Area: /CRMBW/OLTP_EXTRACT_SRV_ORDER
As a result I can now continue with my simulation report to calculate these two key figures with the same logic:
Now execute the report, and you can get the same calculated value as you see in WebUI for posting date 2015.01.27:
Alternatively I have written another report which calls the Reporing framework API from a higher level. The two steps mentioned above are embedded within API RSOA_DSOURCE_READ_REMOTE_DATA.
Of source the response stored in l_t_container has compressed format, which could be parsed by the corresponding program specified in variable l_program.
The name of this program could be read from function module RSAR_ISOURCE_MD_T_GET. See the following report as an example:
The program name to parse the reporting response into ABAP format is stored in variable l_s_ts: