Skip to Content

How to write annotation in SEGW for Smart chart

Feb 19 at 09:25 AM


avatar image
Former Member

We are going to create sap fiori appliction using smart chart but unable to create it, facing issue with annotation in segw not getting populated sap-aggregation-role = 'dimention' or 'measure' please help us to full fill this requirment.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Joseph BERTHE Feb 21 at 04:51 AM

You have to redefine the method define in the class _MPC_EXT.

In it you have an instance of the model : me->mo_model or something like this. The after getting the instance of your entity type you will have access to the properties. And then add annotation or modify the aggregation.



10 |10000 characters needed characters left characters exceeded
Vaibhav Maheshwari Feb 21 at 05:00 AM

All the annotation properties can't be set using the SEGW Transactions.

For the additional properties which you want to set, you will need to add them in the DEFINE method of the MPC Class.

Redefine the DEFINE method in MPC_EXT class.

Don't forget to use super->define( ) in your redefined method.

After that, add the annotations by reading the Entity from the model and property from the Entity.

" Fetch the entity Type
lo_entity_type = model->get_entity_type( 'Entity_Name' ).
/iwbep/if_ana_odata_types=>gcs_ana_odata_semantic_value-query-aggregate ).

" Add all properties with measures/dimensions
lo_property = lo_entity_type->get_property( 'Property_Name' ).
lo_annotation =
/iwbep/if_mgw_med_odata_types=>gc_sap_namespace ).

iv_key = /iwbep/if_ana_odata_types=>gcs_ana_odata_annotation_key-aggregation_role
iv_value = /iwbep/if_ana_odata_types=>gcs_ana_odata_annotation_value-measure-measure ).

10 |10000 characters needed characters left characters exceeded