Quantcast
Channel: SCN: Message List - SAP Gateway
Viewing all articles
Browse latest Browse all 6105

problems with add annotations in 'MPC_EXT' class.

$
0
0

Hi all,


I'm testing the UI5 object 'TREETABLE' with 'SMARTTABLE'. It needs adding annotations from the odata service.

 

I tried to add annotations using the 'XXXXX_MPC_EXT' object. It seems '/IWBEP/IF_MGW_ODATA_ANNOTATABL~create_annotation' can add annotations. But it doesn't add an annotation to the metadata.

 

Here is my codes in DEFINE() method:

 

 

method DEFINE.

     data:

         lo_annotation     type ref to /iwbep/if_mgw_odata_annotation,                "#EC NEEDED

         lo_entity_type    type ref to /iwbep/if_mgw_odata_entity_typ,                "#EC NEEDED

         lo_complex_type   type ref to /iwbep/if_mgw_odata_cmplx_type,                "#EC NEEDED

         lo_property       type ref to /iwbep/if_mgw_odata_property,                  "#EC NEEDED

         lo_entity_set     type ref to /iwbep/if_mgw_odata_entity_set.                "#EC NEEDED

 

super->define( ).

***********************************************************************************************************************************

*   ENTITY - Zx108TCifppidx

***********************************************************************************************************************************

 

lo_entity_type = model->get_entity_type( 'Zx108TCifppidx' ). "#EC NOTEXT

 

***********************************************************************************************************************************

*Properties

***********************************************************************************************************************************

lo_property = lo_entity_type->get_property( iv_property_name = 'Ifname' ). "#EC NOTEXT

lo_annotation = lo_property->/IWBEP/IF_MGW_ODATA_ANNOTATABL~create_annotation( 'sap' ).

lo_annotation->add( iv_key = 'hierarchy-parent-node-for' iv_value = 'Ns' ).

lo_entity_type->bind_structure( iv_structure_name   = 'ZX108_T_CIFPPIDX'

                                 iv_bind_conversions = 'X' ). "#EC NOTEXT

 

endmethod.

 

 

DEBUG shows the annotation is successfully transformed using Transform 'ID', but it is not show in metadata.

 

I don't know if it is a right method to add annotations. I hope someone can tell me somethings about it. Thank you.


Viewing all articles
Browse latest Browse all 6105

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>