cancel
Showing results for 
Search instead for 
Did you mean: 

Update error in NetWeaver Gateway

0 Kudos

Hi,

I have created a service in Gateway. I get the results when I use GET for my url.

http://xxx.sap.corp:1080/sap/opu/odata/sap/ZICP_SO_SRV/SOSet('0500000004')/SOItemSet(ItemPos='10',SO...')

When I try to update the content using PUT method from Gateway client, i get the below error.


<?xml version="1.0" encoding="utf-8" ?>

- <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<code>005056A509B11EE1B9A8FBE8A101378B</code>

<message xml:lang="en">ResourcePath with NavigationPath is not supported for this Request Type</message>

</error>

I am using the same url which is used in GET, this gives me the exact line item of sales order which needs to be updated.

I have also implemented Update methods in the generated class.

Can anyone help me here?

Thanks,

Swetha

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi Arun and Aakash,

Thanks for your reply.

I realized it after some trail and errors. I am able to trigger PUT now.

Thanks for the reply.

Regards,

Swetha

Former Member
0 Kudos

Hi Swetha,

You are in fact correct in attempting to do this, under the OData conventions it should be possible to update an entity via the navigation that you used to locate it. I had exactly the same issue and found that it was not supported.

Earlier versions of Gateway/SAP OData had a rule that you could only update an entity using its canonical URI, but that has since been relaxed. Not sure which SP release it was on but it might have been SP5. I have been able to perform navigation endpoint updates as a result of this change.

regards

Ron.

kammaje_cis
Active Contributor
0 Kudos

Hi Ron,

Are you sure you are able to do that now?

I have a latest GW system, but not able to do that.

Note 1574568 - SAP NetWeaver Gateway 2.0 - Known Constraints says

  1. No POST, PUT, DELETE, MERGE on navigation path.
    1. Updates are only allowed on the canonical URI.  Reason is that the semantics are not clear. What do you modify? The association? The target entity? Both?
    2. POST possible as of SP4. Here the assumption is that you create both the target entity as well as the association.
Former Member
0 Kudos

Hi Krishna,

I think I was referring to the ability to do POST as in the above note.

I really do not understand why SAP say "Reason is that the semantics are not clear. What do you modify?". The URI contextualises the request, in all cases that I've wanted to use this (missing) feature. Other developers of non-SAP OData services have it, so how is it unclear in the SAP implementation? Sounds like smoke and mirrors, and also the fact that this feature would be difficult to implement on ( ) RFC generated services due to the inherent inflexibility of that modelling technique.

kammaje_cis
Active Contributor
0 Kudos

Thanks Ron for getting back.

Yeah, without this, I have to add parent IDs in child, so annoying and inefficient.

Andre,

Your comments please. Also, do you think this feedback can be taken by SAP?

Former Member
0 Kudos

I'm just as confused as you are. If the semantics are unclear for an update/delete then why are they clear for a read using the same URL?

This really wouldn't be an issue at all if create/delete was supported when using $links.

arunchembra1
Participant
0 Kudos

HI Swetha,

Please find the below links :

http://scn.sap.com/thread/3416603

https://scn.sap.com/thread/3424154

While get service fetch X_CSRF Token value apply the same for PUT.

Thanks,

Arun

former_member195242
Active Participant
0 Kudos

Hi Swetha,

When you do a GET operation on the above said URL, you also get a URL using which you can do a PUT/DELETE operations. This URL is in the tag <id>, example:

<id>https<host>:<port>/sap/opu/odata/sap/ZICP_SO_SRV/SOItemSetItem(Pos='10',SOId='500000004')</id>

You should be using this URL to update your entity.

Best regards,

Aakash