Show TOC

Model Composition for Integration ScenariosLocate this document in the navigation structure

Model Composition allows for mashing up multiple services.

Context

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 SAP_GWFND. 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 Start of the navigation path SAP NetWeaver Next navigation step  SAP Gateway Next navigation step  OData Channel Next navigation step  Composition Next navigation step  Create BAdI Implementation for Model Composition  End of the navigation path

Prerequisite

You need to have software components SAP_GWFND installed in your system landscape.

Procedure

  1. 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' ). 
    
  2. Define the navigation and association between two or more models (this step is optional).
    1. 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
      ). 
      
    2. 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'
      ). 
    3. 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'
      ). 
      
  3. Implement a custom navigation functionality on the SAP Gateway hub system if the default handling is not sufficient (this step is optional).
    In transaction SPRO open the SAP Reference IMG and navigate to Start of the navigation path SAP NetWeaver Next navigation step  SAP Gateway Next navigation step  OData Channel Next navigation step  Composition Next navigation step  Create BAdI Implementation for Model Composition  End of the navigation path
    Model Composition
    1. 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).
    2. Create the BAdI implementation by entering the Enhancement Implementation and a Short Text and then Creation of Enhancement (Enter).
    3. Enter the package name for your implementation. The enhancement implementation for the BAdI displays.
    4. Define a filter for your purpose.
    5. 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.