cancel
Showing results for 
Search instead for 
Did you mean: 

How do we create a new Child node without updating or creating the root node in SAP Gateway Client?

Hi,

I have a parent entity and a child entity in my oData Service that was created using CDS views.

The scenario is to be able to just add a new child node to an existing root node. How could we do this in the SAP Gateway Client.

I tried the POST operation on the Child entity Set by providing the Parent key and other field values but I got an error message 'Invalid method invocation: 'CREATE' method is called on the non-root entity 'ZXXXXXXX''.

I tried calling PUT at root entity level and tried to pass child node values but that failed too.

So how would we deal with this scenario? Please guide.

Best Regards,

Raju


Accepted Solutions (0)

Answers (5)

Answers (5)

former_member750657
Discoverer
0 Kudos

Hello, everyone.

Any news about how to solve this issue?

Thanks in advance.

daniel_ruiz2
Active Contributor
0 Kudos

we had the same issue today, it seems because we are trying to utilize BOPF and SADL - which really, is an extremely poor implementation from SAP, top to bottom.

wondering if there are any updates on this - for instance, when working with OData Model we end up with a createEntry on an EntitySet, and submitChanges will post to the EntitySet directly and not to the NavProperty - so basically we need to implement a lot of crap code in SAPUI5 side because someone did half job (or no job) on the back-end when working with SADL classes.

would be quite nice to hear from someone from SAP on how to make this work properly, I really dislike to ship crap code and it seems the only way is really to code garbage.

former_member230443
Participant
0 Kudos

I was able to make it work via the following call. But this will work only for 1:n association. For 1:1 associations, I am still trying to find a proper solution.

POST xABCDxC_RootEntitySet(Key='KeyValue')/to_Child1
rb
Active Participant
0 Kudos

Any News on this one?

former_member516423
Participant
0 Kudos

Hi Raju Dantuluri,

Do you have any solutions yet?

Thanks

Tri