on 08-24-2015 4:15 AM
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.
Hi gemen
have you solved this problem, i want to use this SAPUI5 Explored control too, but not sure how to write the code on Gateway side, can't find any code related to ZIVZ_COA_SRV which used in the sample code.
would you please share your code? or any guide link will be a great help for me.
thanks,
Billy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding annotation code looks good to me.
-> Did you clear metadata cache?
-> Why do you need to bind structure again? It should be present already in super->define() isn't it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.