Adding a new Custom Dimension in the CBA – How to Do
Many a times we may have created new attributes in the Data Model and which might be in need to control the UI adaptations. In this case new dimensions can be added to the Adaptations to control the UI properties.
How to Do:
Check the view FPM_V_ADAPT_SCHM in SM30 to get the schema name in which the new dimension has to be added
Open the view FPM_V_ADAPT_DIM to add the new dimension in the selected view. Now add the new entry along with the index value and the Data element.
Data elements with value table or value ranges will show the respective values in the CBA dimension list.
Now Go to the Component configuration in the edit mode and click on the Adaptation icon. Now the newly added field will be displayed in the list of dimensions available.
Now add a new Adaptation with the respective value for the Target system selected form the F4 help if available.
Set the value for the CBA dimension field in the Root class CL_BS_BP_GUIBB_ROOT in the post exit method of GET_DATA for the respective entity. Read the entity get the value of the field and set it to the dimension created using the below code.
This code should be restricted based on the business activity and the Change request type so that it should be triggered only for the necessary condition in the BP model.
IF lv_target IS NOT INITIAL.
me->mo_reporting = cl_bs_inob_observation_center=>get_instance( )->establish_reporter( me IF me->mo_reporting IS BOUND.
me->mo_reporting->switch_to_scene( ‘CBA_DIMENSIONS’ ).
iv_incident = ‘ZTARGET’
iv_value = lv_target
Hope this helps. Cheers 🙂 Happy Learning
IF lv_target IS NOT INITIAL. me->mo_reporting = cl_bs_inob_observation_center=>get_instance( )->establish_reporter( me IF me->mo_reporting IS BOUND. me->mo_reporting->switch_to_scene( 'CBA_DIMENSIONS' ). me->mo_reporting->value_was_changed( iv_incident = 'ZTARGET' iv_value = lv_target ). ENDIF. ENDIF.
Nice Blog. Thanks for sharing.