on 02-11-2016 8:56 PM
Hello, getting Resource not found for segment ''. when we run sap/opu/odata/SAP/SRA004_SRV/Travels('2000000155').
For some reason, this GET_ENTITY call works fine in Fiori itself, but when testing the call from gateway client or browser we get that error or sometimes Resource not found for segment 'Travel'.
Tried clearing cache and loading metadata, but that didn't help.
sap/opu/odata/SAP/SRA004_SRV/Travels comes back 200, so it can see the resource.
This also happens in our Z extension of the project, and for any new GET_ENTITY we make in that project.
Any ideas?
OK, it turned out to be something fairly obvious -- we were calling this as a Read (GET_ENTITY) when only Query (GET_ENTITYSET) was set up (this was not totally obvious, because none of this was implemented in SEGW, it's all custom methods). Somehow I got the impression from the web side that the Travel app was calling a Read but now I'm pretty sure they are only doing the Query. Apparently within these non-SEGW implementations, sometimes even the generic READ method to find the correct entity READ method doesn't get called, let alone the actual READ entity method in the DPC_EXT class.
So, at least I learned that the "resource not found" error can result from SAP looking for methods that are not implemented (as opposed to returning the "not implemented" error from within the method itself).
Leaving this here in case it helps someone else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Some further info: GET_ENTITY does not work, and neither does DELETE or GET_ENTITYSET, but the POST-based CREATE_DEEP_ENTITY does work (including the UPDATE functionality built into it). Remember, this is all in SRA004, so there's no custom code.
The same is true for our Z version (ZRA004), where we added an Advances entity to Travels and called our custom RFC -- only the POSTs work, not the GETs or DELETEs.
And again, they work when our web guys call it from Fiori, just not from a Gateway client session or from browser directly. This most okay for the SRA004 but obviously it's hard to develop our ZRA004 that way.
Also, weirdly, it sometimes actually runs the RFC (we know because it hits a debug point) so it's like the error is happening when it sends the output from the redefined method. But then other times it doesn't run the RFC, for the same call a few minutes later. Seems like some cache craziness, but doing the cache results and metadata loads didn't accomplish anything.
If no one else has run into this, I guess I might have to just debug the whole SAP stack and see where it's losing its marbles (which is a little tough because there's a one-minute timeout). I did see a note for a similar error with SRA016 so I might try looking at that code first.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dave,
In method GET_ENTITY if it does not find any relevant data, how are populating the return structure? I guess you have to send the key atleast back.
What I mean is
When you call sap/opu/odata/SAP/SRA004_SRV/Travels('2000000155')
If the key 2000000155 has valid values to be returned, then you will get the data.
But if you call
sap/opu/odata/SAP/SRA004_SRV/Travels('12345678')
You would get 'Resource not found for segment 'Travel'.
Regards
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dave,
This may be simplistic, but your Travels is working, but Travel is not?
Is this a typo in your Discussion or in your gateway script?
Regards, Mike
SAP Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.