Skip to Content
avatar image
-1
Former Member

How to write annotation in SEGW for Smart chart

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • 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.

    Regards,

    Joseph

    Add comment
    10|10000 characters needed characters exceeded

  • 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' ).
    lo_entity_type->set_semantic(
    /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 =
    lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation(
    /iwbep/if_mgw_med_odata_types=>gc_sap_namespace ).

    lo_annotation->add(
    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 ).

    Add comment
    10|10000 characters needed characters exceeded