on 07-23-2015 7:19 PM
Hi everyone.
I am building a Gateway project in the Gateway Service Builder (SEGW). I would like to assign values to the following two specific property annotations in the data model of my project:
sap:display-format
sap:filter-restriction
My Gateway project type is "2 - Service with vocabulary-based annotations". I have also imported each of the available vocabularies from the repository.
Many annotations are available in my project, but I am unable to find sap:display-format and sap:filter-restriction.
Can anyone steer me in the right direction? In which vocabulary should the definition of these specific annotations reside?
Thank you!
Chad
Hello Chad:
I had same issue and I couldn't find how to solve it using the SEGW. I think it's not a complex tool and it doesn't have all the annotations. I have used the MPC_EXT class for adding the annotations that I couldn't add with SEGW. Here you have an example:
1. Go to DEFINE method on your service MPC_EXT class
2. Add something like this to your code:
method DEFINE.
DATA: lo_entity_type TYPE REF TO /iwbep/if_mgw_odata_entity_typ,
lo_property TYPE REF TO /iwbep/if_mgw_odata_property,
lo_annotation TYPE REF TO /iwbep/if_mgw_odata_annotation. "#EC NEEDED
FIELD-SYMBOLS: <lo_property> LIKE LINE OF lt_properties.
super->define( ). "Ensure you call the parent metadata
lo_entity_type = model->get_entity_type( iv_entity_name = 'PosicionPedido'). "Entity name
lo_property = lo_entity_type->get_property( iv_property_name = 'Audat'). "Property to be annotated
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 = 'display-format' iv_value = 'Date' ). "Add new annotation.
endmethod.
Done, you will see the new sap:display-format="Date" on your service metadata.
I hope to be helpfull,
Didier
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chad,
Have you found a solution to this? I have the same problem. Looking forward to your response. Thank you.
Regards,
Tejas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
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.