-
Non-Product Related Assistance
Request for existing cases, user IDs, Portal navigation support and more
Request for existing cases, user IDs, Portal navigation support and more
This page describes how a custom KPI for an ABAP-based component can be defined and instrumented. You can select the respective service type during the definition of the KPI.
The definition of the KPI is done in the Business Process Monitoring Application. Details on Creating Custom KPIs(opens in new tab) are available on the SAP Help Portal.
For the definition and the instrumentation relevant technical aspects of a KPI are name, identifier, service type, header, and data. These details are relevant for the instrumentation of the custom KPI and will be used in the specific steps.
The following steps describe how to implement a custom KPI in the managed component and require ABAP development knowledge.
Info: You must define a separate class for each KPI, the example below is using the KPI ZKPITA0001.
Step 1: Create the custom KPI in SAP Cloud ALM Business Process Monitoring using KPI Management. During this process, you also need to select the KPI category, such as Throughput or Backlog.
For a full description, refer to the KPI Categories in SAP Help Portal.
The screenshot below shows the result for the example KPI used in this context.
For more details, see: Creating Custom KPIs in SAP Help Portal.
Step 2: Create a subclass of /SDF/CL_CRBPA_CKPI
Step 3: Implement the following two methods of the interface /SDF/IF_CRBPA_CKPI
method /sdf/if_crbpa_ckpi~get_kpi_id.
rv_kpi_id = 'ZKPITA0001'.
endmethod.
method /sdf/if_crbpa_ckpi~get_data.
data lt_sbook type table of sbook.
data lv_look_back_time type dats.
get time stamp field data(lv_collection_time).
lv_look_back_time = sy-datum - 180.
select carrid connid fldate bookid forcuram from sbook
into corresponding fields of table lt_sbook
where fldate >= lv_look_back_time.
loop at lt_sbook into data(wa_sbook).
insert value #(
id = wa_sbook-carrid && wa_sbook-connid && wa_sbook-fldate && wa_sbook-bookid
field_1 = wa_sbook-bookid
field_2 = wa_sbook-fldate
field_3 = wa_sbook-forcuram
field_4 = wa_sbook-carrid
timestamp_utc = lv_collection_time
) into table et_data.
endloop.
endmethod.
Result of Step 2 and 3: The following example shows the class with the redefined methods:
Step 4: (No manual activity required – automatic step)
Once the next auto discovery execution starts, the custom KPI will be included in the data collection and be available in Business Process Monitoring with the next execution of the data collection.
Info: The auto discovery is scheduled on an hourly basis. You might need to wait for the next regular execution.
Once Step 4 was executed and the data collection took place successfully, you can see the details on the data collection in the KPI Management as well as the relevant data in the Business Process Monitoring application:
KPI Card of the Custom KPIs with category, value, trend rating, and different events
Custom KPI Details covering toggle filter bar, graph and document details based on instrumentation steps described above
Custom KPI registered via the existing framework (Auto Discovery) and active Data Collection