cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping to an OData service with multiple associations / deep insert

tomvanrooijen
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

tomvanrooijen
Participant
0 Kudos

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