Model composition is provided for complex scenarios for the integration topics, such as SAP Business Warehouse, GenIL and SPI. It allows mashing up multiple services within IW_BEP. Thus services and model implementations can be reused for other use cases. You can, for example, compose two or more services to form a completely new service without having to change the existing services.
The resolution of the navigation (to which end point and service the request is routed finally) can be overruled by custom coding. This resolution of the proper navigation is done on the SAP Gateway hub system with only a minimal footprint on the hub.
For model composition an IMG activity is available in the SAP Gateway hub system: In transaction SPRO open the SAP Reference IMG and navigate to .
You need to have software components IW_FND and IW_BEP installed in your system landscape.
Define your model composition.
Out of two or more existing models/services create one new service with additional semantics and navigation options. For this you use method INCLUDE_MODEL_BY_NAME of interface /IWBEP/IF_MGW_ODATA_MODEL.
Example:
model->include_model_by_name( iv_service_external_name = 'RMTSAMPLEFLIGHT' iv_service_version = '0001' iv_model_tech_name = '/IWBEP/OM_SAMPLE_EXTD_SFLIGHT' iv_model_version = '0001' ).
Define the navigation and association between two or more models.
Note that this step is optional.
Define the association between the current model and the included one by using the following:
Example:
iv_def_assoc_set = abap_false lo_association = model->create_association( iv_association_name = 'ConnectionCo2' iv_left_type = 'EXT_ZML_FLIGHTCO2' iv_right_type = 'Flight' iv_right_card = cardinality_entity iv_left_card = cardinality_entity iv_def_assoc_set = abap_false ).
Define the proper association set:
Example:
model->create_association_set( iv_association_set_name = 'ConnectionCo2_ASSOC_SET' iv_left_entity_set_name = 'EXT_ZML_FLIGHTCO2Collection' iv_right_entity_set_name = 'FlightCollection' iv_association_name = 'ConnectionCo2' ).
Define the navigation property between the two models by using the new association:
Example:
lo_entity->create_navigation_property( iv_property_name = 'co2flight' iv_association_name = 'ConnectionCo2' ).
Implement a custom navigation functionality on the SAP Gateway hub system if the default handling is not sufficient.
Note that this step is optional.
In transaction SPRO in the SAP Gateway hub system open the SAP Reference IMG and navigate to .
Carry out the activity by choosing the Activity icon.
If a popup appears with the information that a BAdI implementation is created for BAdI /IWFND/BD_MGW_MDL_COMPOSITION of enhancement spot /IWFND/ES_MGW_MDL_COMPOSITION, choose Continue (Enter).
Create the BAdI implementation by entering the Enhancement Implementation and a Short Text and then Creation of Enhancement (Enter).
Enter the package name for your implementation.
The enhancement implementation for the BAdI displays.
Define a filter for your purpose.
Implement the navigation using SE80.
All changing parameters can be modified. This means that the navigation path, the table of key properties, as well as the select option table can be changed within the implementation.
For more information on the integration scenarios, see: