Ansicht
Dokumentation

BADI_PPM_RISK - BAdI: Risk Score Calculation

BADI_PPM_RISK - BAdI: Risk Score Calculation

BAL_S_LOG - Application Log: Log header data   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Use this Business Add-in (BAdI) for both Portfolio Management (PPM-PFM) and Project Management (PPM-PRO) components to calculate the custom risk scores. The score is based on the risks associated to portfolio items or projects. You can display these scores as custom fields on the user interface.

  • For Portfolio Item: Map item-type to a risk profile ID in SPRO setting.
  • Click SAP Portfolio and Project Management -> Portfolio Management -> Global Customizing -> Portfolio-Independent Settings -> Define Portfolio Item Type.
  • For Project: Map project-type to a risk profile ID in SPRO setting.
  • Click SAP Portfolio and Project Management-> Project Management-> Structure-> Define Project Types
  • Set filter of the Business Add-in to RIHfor Portfolio Items and DPOfor Project Management Project.

For Portfolio Item:

Create CI_ITEM_RISK_SCORES in the database table RPM/ITEM_D and add custom fields to hold the custom risk scores. To view custom fields in the portfolio item:

  1. Add custom fields to customizing activity Define Custom Field Configuration with object type RIH.
  2. Assign custom fields to the portfolio item's view (for example, Additional Information) in the customizing activity Assign custom fields to Viewsand Sub Viewswith object type RIH.

For Project Management Project:

Create CI_PROJ_RISK_SCORES in the structure DPR_TS_PROJECT_EXTENDED_ATTR and add custom fields to hold the custom risk scores. To view the custom fields in the Project:

  1. Add custom fields to the customizing activity Set Up Field Control for the object type and define field groups for customer fields.
  2. Follow steps from SAP Note: 2193819

Method

CALCULATE_RISK_SCORES

You can use this Business Add-in (BAdI) method CALCULATE_RISK_SCORES to calculate the risk score of Portfolio Item or Project.

This method is called when the button 'Save' is clicked on the 'Risk Register' screen, provided the BAdI implementation is active.

By default, there is no BAdI implementation in the standard system and hence risk score is not calculated for the portfolio item or project.

Note: The BAdI is designed for multiple use and is filter dependent.

For information about the standard settings (filters, single or multiple uses), see the Enhancement Spot Element Definitions tab in the BAdI builder (transaction SE18).

Use the method ‘GET_RISK_DETAILS’ of class ‘/CPD/CL_RM_PROCESSING’ to retrieve the existing risk(s) of a portfolio item or a project by passing the item or project GUID (IV_OBJ_GUID). You can build a custom logic to calculate the risk score fields using risk details (for instance, risk score per ‘Category’ or risk score based on ‘Impact’) and update the custom fields in the structure CS_RISK_SCORE_FIELDS.

For example, in case of calculating risk score for portfolio item, a custom field ZITEM_RISK_SCORE is defined in the custom include CI_ITEM_RISK_SCORES. You can implement this for the filter on ‘RIH’ and BAdI method 'CALCULATE_RISK_SCORES as shown below:

*&---------------------------------------------------------------------*

* The below piece of code updates the custom field ' ZITEM_RISK_SCORE' with the summation of all risks (Risk Score) belonging to risk category id as '0002' to a portfolio item.

*&---------------------------------------------------------------------*

* DATA lv_item_score TYPE /cpd/rm_risk_score VALUE 0.

* IF iv_obj_guid IS NOT INITIAL.

* /cpd/cl_rm_processing=>get_reference( )->get_risk_details(

* EXPORTING

* iv_obj_guid = iv_obj_guid

* IMPORTING

* et_risk_root_data = DATA(lt_root_risk)

* eo_message = DATA(lo_message) ).

* IF lt_root_risk IS NOT INITIAL.

* LOOP AT lt_root_risk INTO DATA(ls_risk) WHERE cat_id = '0002'.

* lv_item_score = lv_item_score + ls_risk-risk_score.

* ENDLOOP.

* cs_risk_score_fields-zitem_risk_score = lv_item_score.

* ENDIF.

* ENDIF.

Similarly, the above piece of code can be altered to have changes for custom fields added in ‘CI_PROJ_RISK_SCORES’.






BAL Application Log Documentation   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 5055 Date: 20240524 Time: 003552     sap01-206 ( 79 ms )