Log on to the SAP Gateway System on which the software component IW_BEP is deployed.
Go to transaction SE24.
Create a new ABAP OO Metadata Provider Class.
Derive your class from super class /IWBEP/CL_MGW_ABS_MODEL.
Redefine method GET_LAST_MODIFIED.
GET TIME STAMP FIELD rv_last_modified. |
Time stamp last modification: Last-Modified in the HTTP header is set based on this time stamp. Web Infrastructures can use this header field to carry out caching.
Redefine the method DEFINE of your metadata provider class.
Sample code
DATA: lo_annotation TYPE REF TO /iwbep/if_mgw_odata_annotation, lo_data_object TYPE REF TO /iwbep/if_mgw_odata_entity_typ, lo_flight_object TYPE REF TO /iwbep/if_mgw_odata_entity_typ, lo_entity_set TYPE REF TO /iwbep/if_mgw_odata_entity_set, lo_complex_type TYPE REF TO /iwbep/if_mgw_odata_cmplx_type, lo_association TYPE REF TO /iwbep/if_mgw_odata_assoc, lo_property TYPE REF TO /iwbep/if_mgw_odata_property, lo_action TYPE REF TO /iwbep/if_mgw_odata_action, lo_parameter TYPE REF TO /iwbep/if_mgw_odata_parameter. * first creating the flight data object lo_flight_object = model->create_entity_type( 'Flight' ). * define properties + keys lo_property = lo_flight_object->create_property( iv_property_name = 'carrid'). lo_property->set_is_key( ). lo_property = lo_flight_object->create_property( iv_property_name = 'connid'). lo_property->set_is_key( ). lo_property = lo_flight_object->create_property( iv_property_name = 'fldate'). lo_property->set_is_key( ). lo_flight_object->create_property( iv_property_name = 'PRICE' ). lo_flight_object->create_property( iv_property_name = 'CURRENCY' ). lo_flight_object->create_property( iv_property_name = 'PLANETYPE' ). lo_flight_object->create_property( iv_property_name = 'SEATSMAX' ). lo_flight_object->create_property( iv_property_name = 'SEATSOCC' ). lo_flight_object->create_property( iv_property_name = 'PAYMENTSUM' ). lo_flight_object->create_property( iv_property_name = 'SEATSMAX_B' ). lo_flight_object->create_property( iv_property_name = 'SEATSOCC_B' ). lo_flight_object->create_property( iv_property_name = 'SEATSMAX_F' ). lo_flight_object->create_property( iv_property_name = 'SEATSOCC_F' ). lo_flight_object->bind_structure( 'SFLIGHT' ). * create an entityset name, by default there is a entityset called <entity type> Collection, so the following could be also ignored lo_entity_set = lo_flight_object->create_entity_set('Flights' ). |
Activate the class.
Continue with Implementing Entity Data Provider
Back to Developing Content on SAP Gateway OData Channel Using IWBEP