Skip to Content

Mapping to an OData service with multiple associations / deep insert

Hi,

Im SAP Cloud Integration I want to interface to an OData service that has multiple associations. The OData service is defined in Hana XS and points to an XS schema:

service namespace "OpenOrders.services" {

     "OpenOrders.data::OpenOrders.OpenOrder"        as "OrderHeader"  
     navigates("ToOrderItem" as "ItemRef","ToShipDetail" as "ShipRef", "ToBillDetail" as "BillRef");

     "OpenOrders.data::OpenOrders.OrderItems"       as "OrderItems"; 
     "OpenOrders.data::OpenOrders.BillingDetails"   as "ShipDet";    
     "OpenOrders.data::OpenOrders.ShipmentDetails"  as "BillDet";    
     
     association "ToOrderItem"   with referential constraint principal "OrderHeader"("OrderId") multiplicity "1" dependent "OrderItems"("OrderId") multiplicity "*";
     

association "ToShipDetail"  with referential constraint principal "OrderHeader"("OrderId") multiplicity "1" dependent "ShipDet"("OrderId")    multiplicity "1";
     

association "ToBillDetail"  with referential constraint principal "OrderHeader"("OrderId") multiplicity "1" dependent "BillDet"("OrderId")    multiplicity "1";
    }

In the mapping step itself I can select the target .edmx (the metadata of the above OData) but then I can only choose one of the entitysets as a target for the mapping.

So how do I include the related entitysets as well? I prefer to use the OData service as receiver but it is not strictly necessary.

I guess I can create one mapping per target entityset and fire several odata calls to create the data but I am hoping that there is a cleaner way of accomplishing this.

Thanks,

Tom

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Aug 23, 2017 at 05:30 AM

    Hi Tom,

    Currently, message mapping doesn't support multiple messages if any of them is of type edmx. To achieve this, the current way is go for multiple message mappings only, then use a gather step to join them. Hope this helps

    Thanks & Regards,

    Vishnu Prasath

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Vishnu,

      Thanks for your answer.

      That would solve the mapping problem.

      Additionally though the OData functionality on XS does not support an update on an OData model with associations (multiple tables). The Add, Update and Delete functionalities only seem to work for OData models referring to single tables.

      Kind regards

      Tom