setProperty in association of OData V2

Viewed 194

I got the following problem:

I created an entity set with an association to another entity set.

Let's assume it is something like this:

/C_Header(headeruuid="dldnal122.....")

now this has an association like this:

/C_Item(itemuuuid="l23sdl....")

On this association I have a property let's say "Reicever"

Now if I use the /N/IWFND/GW_CLIENT

I can get the information from the association by calling the following url with a GET request:

/sap/opu/odata/sap/Adress_SRV/C_Header(headeruuid=guid'0894ef4...',IsActiveEntity=true)/to_Item(itemuuid=guid'0894e....',IsActiveEntity=true)/Reicever

The result would be "Thomas" for instance.

Now I want to set this property from the frontend, so I tried the following:

oModel.setProperty("/C_Header(headeruuid=guid'0894ef4...',IsActiveEntity=true)/to_Item(itemuuid=guid'0894e....',IsActiveEntity=true)/Reicever", "Marc");
oModel.submitChanges();

This does not show any error in the console log but also does not change the property either. I also tried the following path:

oModel.setProperty("/C_Item(itemuuid=guid'0894e....',IsActiveEntity=true)/Reicever", "Marc");
oModel.submitChanges();

This shows me an error that this is not a valid property path in the console log.

What am I doing wrong here? I am not really understanding what I am not doing correctly.

Any help highly appreciated.

0 Answers
Related